View Full Version : CA / maxscript newbie

12 December 2008, 12:08 PM

Im trying to make some small tools for example and automatic screw dummy object for technical animations which automaticaly will rotate when keyed along a specified axis. The Custom attribute will make me able to quickly change the height of the screw...

I think I need some good advise on how to structure my script - and In what order things are executed etc...



fn makeobj =
sobj = dummy() = "ScrewObject"
--addModifier sobj (emptymodifier())
custAttributes.add sobj ScrewCA
txt = text()
txt.text = "ScrewHelper"
txt.size = 10
txt.rotation.controller.y_rotation = 90
txt.parent = sobj
fn makectrl =
--animation = bezier_float()
sobj.pos.controller.Z_position.controller = float_list ()
sobj.pos.controller.Z_position.controller.Available.controller = bezier_float()
sobj.rotation.controller.Z_Rotation.controller = float_list ()
sobj.rotation.controller.Z_Rotation.controller.Available.controller = fs
fn makeinterface = (
ScrewCA = attributes "screwdata"
parameters main rollout:params
height type:#float ui:Sheight default:10
rollout params "Screw Parameters"
spinner Sheight "height"
fn makescript = (
global fs = float_script()
fs.script = "k=sobj.screwdata.height

12 December 2008, 01:43 PM
I haven't tested the code but it looks fine, a little hard to tell because you have not used the code tags here so every thing ended up left justified and hard to read. If it works then you are well on your way to writing useful code. A very talented programmer once said to me "the best code is code that works".

CGTalk Moderation
12 December 2008, 01:43 PM
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.