Notifications
Clear all

[Closed] Get the node from inside a custom modifier code?

Hello everyone!

I have a little question which might sound a bit simple for some people, but I can’t find out the answer.

I am currently trying to code a scripted modifier plugin which will do some actions on a spline. It will not be base on any existing modifier.
Inside the code of this modifier, I would like to access to the properties and methods of the spline it is applied to.

But I simply have no idea of how to do that… I mean, what’s the point of making modifiers for nodes if we can’t access the node itself easily? 😮

I was able to find a lot of informations on the official maxscript help here, but nothing on how to access to the node. I spent hours to search on internet, maybe I am not searching correctly or something, but I can’t find it anywhere…

Can somebody give me a hint on that?

Thanks very much!:bowdown:

3 Replies

I also struggled with this the other day, here’s what worked out for me:

plugin something
name:"Something"
(
	local theNode 
	
	parameters main rollout:params
	(
		state type:#boolean ui:chk_state default:true animatable:true
		on state set var do (
			if this == undefined then return false
			theNode = (refs.dependentNodes this)[1]
			if theNode == undefined then return false
		)
	)
	 
	rollout params "Something"
	(
		checkbox chk_state "On/Off" type:#boolean
	)
)

1 Reply
(@stremon)
Joined: 11 months ago

Posts: 0

Wow thank you, that is exactly what I was looking for
You saved my day

If you want to read up on the “this” local variable and other supported local variables to scripted plugins see this maxscript help page.

-Eric