Scripted Modifier - Get reference to object it is applied to?

How can I get a reference to the object my scripted modifier is applied to?

I know there is the

on attachedTo nodeVar do (...)

event handler, but when I try to store nodeVar as a #node parameter, it crashes with a DependencyLoop warning.

Any ideas?

Cheers

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
br0t's picture

Awesome that works, thanks!

Awesome that works, thanks! Still wondering why there is nothing like 'this' or 'delegate' that refers to the object the modifier is applied to and we have to do this kind of hack.

Never get low & slow & out of ideas

barigazy's picture

...

I asked same question when I tryed to write my first scripted plugin but till this day I not know the answer :)

barigazy

barigazy's picture

...

Are you tried something like this

plugin someModifier name:"someModifier"
(
	local theNode 
 
	parameters main rollout:params
	(
		-- ... parametersBlock
	)
 
	rollout params "Something"
	(
		-- ... rollout controls
	)
	on params open do theNode = (refs.dependentNodes this)[1]
)

barigazy

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.