Notifications
Clear all

[Closed] create a script controller variable. How to?

Is it possible to script a variable to use inside a script controller?
You know, as the manual procedure in the script controller user interface:
Create Variable > Create鈥?then Assign Node.

nodeTransformMonitor 鈥?/span>?

thanks

7 Replies

Yes.

For some reason this is purely documented in the MaxScript manual. The script controllers support the same interface as the expression controller. Just search for 鈥渁ddNode鈥?

I do this in the rotation tools scripts that I wrote.

Here鈥檚 a sample:


 		-- create a MaxScript controller
 		s = rotation_script()
 
 		-- this will track the position of the object
 		s.AddNode "wheelControl" wheelControl
 		s.AddNode "wheelGeom" obj
 
 		-- this is the script that will call our getBallRotation function
 		str = "now = ((t / 160.0) as time)
"+ \
 				"if wheelControl != undefined do (
"+ \
 				"	if wheelGeom != undefined do (
"+ \
 				"		if wheelControl.modifiers[\"WheelRotation\"] != undefined do (
"+ \
 				"			return (wheelControl.WheelRotation.getWheelRotation now wheelControl wheelGeom "+(keep_rotation as String)+" "+(simpleRadius as string)+" "+(hasRadius as string)+")
"+\
 				"		)
"+ \
 				"	)
"+ \
 				")
"+ \
 				"return (quat 0 0 0 1)"
 
 		-- start the controller up
 		s.script = str
 
 		wheelGizmo.rotation.controller = s
 

Hi Mustan9, thank you

I found the .addNode method with showInterfaces MyController. [size=2]But, when I type it in the maxscript user reference found nothing.[/size]
[size=2]I guess I will learn MXS when somebody finishes the manual鈥?[/size]
[size=2][/size]
[size=2]Fernando
[/size]

Details on the new script controller were a major omission in the Maxscript 8 docs, but the Maxscript 9 docs fixed it.

Unfortunately, I can鈥檛 find a link to the latest docs on the Autodesk website anymore. Bobo talked them into offering it freely a while back, but this is the first time since then that I can鈥檛 find it anywhere.

Anyone know if Autodesk changed their mind on this? Bad news if they did, as it helped Bobo with more useful input regarding the docs鈥?/p>

I hate the windows help document. It sucks. Wish we had something more search friendly like the MSDN interface, or just Google!

An online version would be great. Then I could post links!

I found many years ago a Take5.chm file with a lot of questions/answers about MXS. At discreet website I guess.
This was very useful to me, but I would like to find out an updated version.

Fernando

Honestly fferro2, I have to say that having used MAXscript proffesionally for a few years now, I can say the the documentation for it is probably the best I鈥檝e ever seen. The script controller interfaces ommision is one of the only ones i鈥檝e seen, and it was quickly fixed. Bobo even posted about it on CGTalk.

-Dave

1 Reply
(@mustan9)
Joined: 11 months ago

Posts: 0

Compared to the documentation for Maya鈥檚 MEL script, or ZBrush鈥檚 ZScript the MaxScript documentation is much better.

I do know what fferro2 is talking about. Many years ago Autodesk would release the SDK documentation with achieves taken from the Autodesk support forum. They would format it, and release it as a Windows Help Document. It was a rich resource to find answers to strange questions that only us 3D Studio Max developers would ask. Things the Autodesk technical document writers would never put into the documentation.

For some strange reason, Autodesk discontinued releasing this archive after 3D Studio Max 6? (or maybe it was 5). I think this is what fferro2 was talking about.

Picture Autodesk release 3D Studio Max 10 with a searchable Windows Help Document of every post from CGTalk鈥檚 MaxScript forum. That would be amazing!