scale script controller

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Display Modes
  3 Weeks Ago
scale script controller

I need some guide / help on this.

I don't want to use the reaction manager anymore. It is too buggy.
I want to transfer the actions to the scale script controllers.

I have a scale.script controller assigned on a scene object.

in this script i have 2 variables: a and b. (as node)
I want to do this:
if i move in local space the pos.z (positive z axis) of node "a" i want to take the node "b" with him but with a certain offset;
else if i move in local space the pos.z (negativ z axis) of the node "a" in want to node "b" to stay in the original position;

i saw that i can't use "in coordsys local" on this. It gives errors.

I come up with this so far but it's not correct and i am stuck:
This code works only in world coords. Here is a video to understand better:

$script.scale.controller = bezier_scale()

$script.scale.controller = scale_script()
ctrl = $script.scale.controller
ctrl.addNode "a" $Circle001
ctrl.addNode "b" $Circle002
ctrl.script =
if (a.pos.z > 1) do ( b.pos.z = ((a.pos.z) + 1))

[1, 1, 1]
  3 Weeks Ago

delete objects

source = point name:#source pos:[0,0,40] wirecolor:orange
target = point name:#target pos:[20,0,10] wirecolor:green

p = source.pos.controller = position_list()
s = p.available.controller = position_script()

h = target.pos.controller = position_list()
v = h.available.controller = position_xyz()
h.setactive 2

s.addtarget "v_pos" v[#z_position]
s.addconstant "v_offset" 10.0

s.setexpression "[0,0, amax 0.0 (v_pos - v_offset)]"

this is how i would do it.
#1 the using a scale controller for anything else than scale is not a good practice
#2 the using of List controllers give you a way to work with 'relative' offsets instead of 'absolute' values
#3 use subanims instead of direct nodes transforms

Last edited by denisT : 3 Weeks Ago at 07:12 PM.
  3 Weeks Ago
Thank you for your advice and example.

I solved out with two expose helpers and i did all the work with what the helpers exposed.
I needed for a mouth rig.
This is the final result:

Now i am thinking about your solution and i think this is a correct approach.
I will modify the script in the next days.


Last edited by justml : 3 Weeks Ago at 08:32 PM.
  3 Weeks Ago
it's very nice facial setup and clean user interface. good job!
reply share thread

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 05:01 AM.

Powered by vBulletin
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.