Notifications
Clear all

[Closed] ParamWire blending

Hi Guys,

 I am creating a script to blend 3 position_weight values.  FK <----> IK connected to: slider a. The other is a blend between the combined FK&IK weights <----> parented constraint connected to: slider b.
 
 The problem is that I need to recall the values of the IK&FK blended weights to slider b then minus the slider value as a percentage of the two IK_FK weight values.
 
 I have tried creating a function within the expression but it is returning the error No ""-"" Function for undefined, I am oblivious as to how to get the value of the blend weight, any ideas?
 
 Here is some of the code atm:
 
 --slider a
 --Wheel_IK_FK
 paramwire.connect $.modifiers[#PEN_Attribute_Holder_2].stan_Movement[#L_Rear_IK_FK] $CNT_L_Rear_Stan.position.controller[#position_weight_0] "L_Rear_IK_FK"
 paramwire.connect $.modifiers[#PEN_Attribute_Holder_2].stan_Movement[#L_Rear_IK_FK] $CNT_L_Rear_Stan.position.controller[#position_weight_1] "100-L_Rear_IK_FK"
 
 --slider b
 --Wheel Roll
 paramwire.connect $.modifiers[#PEN_Attribute_Holder_2].stan_Movement[#Wheel_Roll] $CNT_L_Rear_Stan.position.controller[#position_weight_2] "Wheel_Roll"
 paramwire.connect $.modifiers[#PEN_Attribute_Holder_2].stan_Movement[#Wheel_Roll] $CNT_L_Rear_Stan.position.controller[#position_weight_0] "Position_Weight_0 - wheel_Roll"
 paramwire.connect $.modifiers[#PEN_Attribute_Holder_2].stan_Movement[#Wheel_Roll] $CNT_L_Rear_Stan.position.controller[#position_weight_1] "Position_Weight_1 - Wheel_Roll"

Thanks,

Aeron

3 Replies

Hey guys,

I found the solution in the form of float script controllers. Here’s a piece of the code:

paramwire.connect $.modifiers[#PEN_Attribute_Holder_2].stan_Movement[#Wheel_Roll] $CNT_L_Rear_Stan.position.controller[#position_weight_2] “Wheel_Roll”

fsP_0 = float_script()
$CNT_L_Rear_Stan.position.controller[#position_weight_0].controller = fsP_0
fsP_0.addTarget “weight_0” $Master_Stan.modifiers[#PEN_Attribute_Holder_2].stan_Movement[#L_Rear_IK_FK]
fsP_0.addTarget “Wheel_Roll” $Master_Stan.modifiers[#PEN_Attribute_Holder_2].stan_Movement[#Wheel_Roll]
fsP_0.script = “(weight_0 / 100) * (100 – Wheel_Roll)

However I have a new problem! haha seems that everytime you climb a hill it leads to another.

The car rig I have setup uses alot of parameter wires and constraints connected to a custom attrib modifier. I am getting very slow performance (around 1 fps). I have seen some very good car rigs on Youtube running very well i.e. http://www.youtube.com/watch?v=czQJ6MjnmHo

I was wondering if anyone has any hints/tips/ideas as to how to speed up the rig?. I am already using disableSceneRedraw for the ca sliders. But moving FK controls in the viewport is too slow for production atm.

Many thanks to anyone who can help,

Cheers,

Aeron

 PEN

Mine is way better then that and I have a pile of calculations running including trig for the suspension. Looking at what you have there I’m not sure why it is running slow.

Thanks for the reply PEN, Yes it’s infuriating! I don’t know why it’s soo slow…do you ever find that having many constraints tied to scripts causes issues? Is there a better way of linking parameters other than wiring?

Yes it’s definately the position and orientation constraints that are causing the slow down. Are there any alternatives? ways of coding constraints in maxscipt more efficiently/differently?

Cheers