I followed a Joe Gunn tutorial for writing a script to link objects. I then made a dialog box out of it, but it doesn't work. I've attached the script. It's short and simple. Two objects are selected and linked. Any help would be appreciated.
Solved! Go to Solution.
Solved by Swordslayer. Go to Solution.
The error message in the listener will basically tell you as much, you used myStart and myEnd in the rollout for buttons, use their .object property, not the button itself. Also, pickButtons don't have 'on pressed' event handler, they use 'on picked' but you don't even need it in simple cases like this:
try destroyDialog _Link catch() rollout _Link "Link Objects" ( pickbutton myStart "Controllee" autoDisplay:on pickbutton myEnd "Controller" autoDisplay:on button moveTo "Position" button _Go "Link" on moveTo pressed do ( if isValidNode myStart.object and isValidNode myEnd.object do myStart.object.position = myEnd.object.position + [0,0,20] ) on _Go pressed do ( if isValidNode myStart.object and isValidNode myEnd.object do myStart.object.parent = myEnd.object ) ) createDialog _Link
Can't find what you're looking for? Ask the community or share your knowledge.