ScriptSpot

Forum topic · General Scripting

scripted Controller (self ref)

By JokerMartini · 2012-06-08

Description

How do you reference an objects self in a scripted controller?

Example. I have a box and I want each box to reference their own width parameter. how do i do that in the scripted controller?

$.width ??

Comments (7)

JokerMartini · 2012-06-08

Thanks Branko for the explanation.
that helped a lot.

barigazy · 2012-06-08

Always John, my pleasure :)

barigazy · 2012-06-08

i think this is better solution than scripted_ctrl

masterObj = Box width:20 length:20 height:20 pos:[0,0,0] name:"Master001" wirecolor:red
masterObj[4][2].track = Bezier_Float()
for b in 1 to 10 do
(
slave = copy masterObj
slave.wirecolor = blue
slave.name = uniquename "Slave"
slave.pos = [0,(b*30),0]
slave[4][2].track = masterObj[4][2].track
)

kimarotta · 2012-06-08

Hey Barigazy... I can ask a question? Which is the number [4] and [2] in "masterObj[4][2].track = Bezier_Float()" ... ?

barigazy · 2012-06-08

Create a box and type in listener $Box001[4] and $Box[4][2] and you'll
get the answer.
Image and video hosting by TinyPic

kimarotta · 2012-06-08

very very good ... Great explanation ... and very thanks

kimarotta · 2012-06-08

I could not understand your question ... would be something with wire parameters?