View Full Version : Set controller on creation of plugin helper
04 April 2008, 03:28 PM
Here is the sort of thing that I'm after but this doesn't work. Any one have a solution to this? I have tried using the postCreate handler as well and that fails to.
plugin helper test
on mousePoint num do
if num==2 then
04 April 2008, 05:15 PM
That that point in time, 'this' merely refers to the plugin as created in memory, not to the specific instance you're creating in the scene.
(refs.dependents this).transform.controller = transform_script()
( This assumes that the first dependent is the node. That's true enough in 3ds Max 5 (which I'm working in atm) but I think may differ in later max versions. )
04 April 2008, 10:28 PM
Max 5?? Wow and I thought I was behind with a Max 8 project.
Thanks, I'll test it and see what I get.
04 April 2008, 11:00 PM
It forces me to consider the limitations of the lower end of software we support; though there's several features available only in newer versions of max... not going so far as to let older software support hinder progress altogether :)
That said - right now I'm tweaking script files so that they'll work with 3ds Max 4. Oie. Did you know that it doesn't have .width and .height properties for rollouts (and thus dialogs)? There's no renderSceneDialog structure either. Yipe.
good luck - scripted plugins of most kinds can be pretty difficult to work with :)
04 April 2008, 11:31 PM
I have written a pile of scripted plugins but not had to do this. Max 4? common, people can't still be on Max 4....can they?
04 April 2008, 11:40 PM
We have two customers still on R3. We dropped R3 support with v2, of course.
04 April 2008, 12:08 AM
R3...Oh my, well it was very stable.
05 May 2008, 12:49 AM
I know it's been more than a month since you posted this, but in case you still need it:
on attachedToNode obj do obj.controller = transform_script()
As the name implies, this event (available to all scripted plugins) will get fired whenever a plugin instance is attached to a node (ie. when a scene node is created).
Well thanks. How about that, I would have never tried it as I thought that attached to would be for something like a script modifier only. Thanks.
05 May 2008, 12:53 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.