Script_controller(need working example)

I wont assign script controller to some box in scene.

---------------------------------------------------------------------

cp=$camera01.pos -- some camera in scene

hp=$point01. pos      -- some helper_point is scene

icp=$point02.pos     -- another helper_point is scene

 

Scontr=scale_script()

box_copy.scale.controller = Scontr    

Scontr.script="[distance cp hp/distance icp hp,distance cp hp/distance icp hp,distance cp hp/distance icp hp]"

?????????????????????????????????????????????????????

what I must use

(AddObject, AddNode, SetObjec,SetNode) to define cp, hp, icp in script_controller?

 

 

 

 

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
sinok's picture

yes, you must add them as

yes, you must add them as targets.. here is your code.

---------------------------------------------------------
Scontr=scale_script()

Scontr.addTarget "cp" $camera01.pos.controller
Scontr.addTarget "hp" $point01. pos.controller
Scontr.addTarget "icp" $point02.pos.controller

Scontr.script="[distance cp hp/distance icp hp,distance cp hp/distance icp hp,distance cp hp/distance icp hp]"

$box_copy.scale.controller = Scontr

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.