ScriptSpot

Forum topic · General Scripting

Script_controller(need working example)

By anybany · 2009-10-26

Description

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 (1)

sinokgr · 2009-10-28

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