[Closed] Stop Staring script
I am coding Stop Staring script that will make all reactions that are needed betwin head morphs and interface.
This is how I want reaction to see out when it is finnished.
This is exemple from MaxScript Reference:
[color=green][color=Red]———————————————————————-[/color][/color]
[left][color=green]– Setup a scene[/color]
[/left]
[left]b1 = box name:“box01” pos:[-32.5492,-21.2796,0] [color=green]– create two boxes[/color]
[/left]
[left]b2 = box name:“box02” pos:[51.3844,-17.2801,0]
[/left]
[left][color=blue]animate[/color][color=blue]on[/color][color=blue]at[/color] time 100 b1.pos = [-48.2522,167.132,0] [color=green]– animate position of one box[/color]
[/left]
[left][color=green]–[/color]
[/left]
[left][color=green]– Assign a reactor, pick the react to object, and create reactions[/color]
[/left]
[left]cont = b2.pos.controller = position_Reactor()
[/left]
[left][color=green]–[/color]
[/left]
[left][color=green]– you can either react to a controller[/color]
[/left]
[left]reactTo cont b1.pos.controller
[/left]
[left][color=green]– or a node (the World Space position of the box)[/color]
[/left]
[left][color=green]– reactTo cont b1[color=Red]
I dont know hot to replace “cont=b2.pos.con…” to work witch morphs insted for poistion.
I tryed: cont = head.morpher 4 = position_Reactor()
[/color][/color]but get this error “– No “”=”” function for ((prop Morpher $huvud) 1)”
[/left]
[color=green][color=White]
dont know hot to replace “cont=b2.pos.con…” to work witch morphs insted for poistion.
[/color][/color]hi dylan think you are looking for
$.modifiers[#morpher][i].controller
where i is the morph target index number
mark
That didnt work, but I think it is right direction.
I cant get this right:
code: reactTo morph “reactor()”
“reactor()” is one of this:
[left]float_Reactor …
[/left]
[left]point3_Reactor …
[/left]
[left]position_Reactor …
[/left]
[left]rotation_Reactor …
[/left]
[left]scale_Reactor …
[/left]
hi,
i have never used reator controllers at all – not with scripting either but i assume access the controllers in exactly the same way as other controllers –
did you type the line exactly 😕
$.modifiers[#morpher][i].controller
you do know that $ is the currently selected object and needs to be replaced by the object pointer of the object containing the morpher modifier
in your case (the example you supplied) this is b2
b2.modifiers[#morpher][i].controller that is assuming there is a morpher modifier on this object.
mark
I get this error:
code:
cont = head.modifiers[#morpher][1].controller = float_Reactor()
error:
– Unknown property: “modifiers” in undefined
code: (witch head slected)
cont = $.modifiers[#morpher][1].value = float_Reactor()
reactTo cont TypeA_point
error:
– Unable to convert: Controller:Float_Reaction to type: Float
– Unable to convert: undefined to type: Controller
code:
cont = $head.modifiers[#morpher][2].value = float_Reactor()
error:
– Unable to convert: Controller:Float_Reaction to type: Float
Thanx for trying to help
hi,
looks like your very new to maxscript – you should read some of the intrductory chapters to understand some basics –
anyway
code: (witch head slected)
cont = $.modifiers[#morpher][1].value = float_Reactor()
reactTo cont TypeA_point
error:
– Unable to convert: Controller:Float_Reaction to type: Float
– Unable to convert: undefined to type: Controller
you are trying to convert the value held in the controller to a controller type , this isnt possible – you need –>
cont = $.modifiers[#morpher][1].controller = float_Reactor()
like i said try reading the maxscript reference a bit – its actaully really good when you understand how to understand it
good luck with maxscript its very usefull
mark
$Box01.modifiers[#morpher][5].controller = float_reactor()
$.modifiers[#PEN_Attribute_Holder_2].Custom_Attributes.Param1.controller = bezier_float ()
cont = $Box01.modifiers[#morpher][5].controller
reactTo cont $box02.modifiers[#PEN_Attribute_Holder_2].Custom_Attributes.param1.controller