kedden
12-10-2008, 12:08 PM
Hi
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...
br
Kedde
fn makeobj =
(
sobj = dummy()
sobj.name = "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
k2=sobj.position.controller.Z_Position.controller[2].value
(k2/k)*2*PI"
)
--
--
makeinterface()
makeobj()
makescript()
makectrl()
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...
br
Kedde
fn makeobj =
(
sobj = dummy()
sobj.name = "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
k2=sobj.position.controller.Z_Position.controller[2].value
(k2/k)*2*PI"
)
--
--
makeinterface()
makeobj()
makescript()
makectrl()
