[Closed] script controller
I need to automate this manual work, assign a script controller to Lattice Transform and create a variable and assign it as a node to itself.
It’s just an example , in the expression is written any text, what I wanted to show are the steps.
delete objects
s = geosphere radius:10 wirecolor:green
p = point size:40 wirecolor:yellow
m = FFD_2x2x2()
addmodifier s m
c = m.Lattice_Transform.controller = transform_script()
c.addtarget "target" p.controller
c.setexpression "target\n"
but all it is not as simple as you think and I showed
so let’s “cross the bridge when one comes to it”
Excellent, it was just what I needed, you make everything much easier to understand when you write your code. Thank you!
believe me you will meet another problems.
#1 Lattice_Transform and point’s transform are in different coordinate systems
but i give you a chance to solve it yourself
but i’m sure you can’t solve it with my help. and I’m very kind today, so:
delete objects
s = geosphere radius:10 wirecolor:green
p = point size:40 wirecolor:yellow
m = FFD_2x2x2()
addmodifier s m
c = m.Lattice_Transform.controller = transform_script()
c.addtarget "target" p.controller
c.addobject "node" (NodeTransformMonitor node:s)
c.setexpression "target * inverse node.transform\n"
A new obstacle arose, I create a new group that is created automatically with a base name.
How do I include it in the variable thegroup??
in the video I make it work because I know what its full name is.
group $'*Character_FFD_*' name:(uniquename "Character_Group_FFD_" + "_" +edtDummyName.text)
theOne.modifiers[#FFD_2x2x2].Lattice_Transform.controller = transform_script ()
s = transform_script ()
thegroup= $Character_Group_FFD_001_
s.AddNode "group" thegroup
str = stringstream ""
format "theOne = $% \n" object
format "inverse group.transform * group.transform" to: str
s.script = str
$.modifiers[#FFD_2x2x2].Lattice_Transform.controller = s