Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk® Softimage® / Animation / Understanding a specific expression
  RSS 2.0 ATOM  

Understanding a specific expression
Rate this thread
 
49115
 
Permlink of this thread  
avatar
  • Location: Toronto, Ontario
  • Total Posts: 1006
  • Joined: 07 June 2009 05:56 PM

I’m hoping you can help me, I’m trying to create blend shapes using a blend shape controller.  I’m not understanding the part I’ve quoted below.  How do you know which part of the controller is 0,0 / 1,1 / -1,-1 etc ?

Mimicking the code in the tutorial I get two blend shapes over lapping or one half way replacing the other.

cond( circle.kine.local.posx > 0, 1, 1 + circle.kine.local.posx )

This states that if the circle is greater than 0 in the x axis, the value will equal 1, if it is less than 0 then the value will equal 1 + the posx value, which is 0 at the centre of the square and -1 at the left.

If when the circle is greater then 0 in the x axis the value for the shape will equal to 1 if it is less then 0 then the value will equal to 1 as well + a posx value ?!?!?!?!?



Replies: 0
avatar

cond( circle.kine.local.posx > 0, 1, 1 + circle.kine.local.posx )

If “circle.kine.local.posx > 0” evaluates to true, then the cond statement evaluates to the value 1.

If “circle.kine.local.posx > 0” evaluates to false, then the cond statement evaluates to the value 1 + circle.kine.local.posx.

So, if posx = 2, then you will get 3.
If posx = -1, then you will get 1.
If posx = 0, then you will get 1.

In pseudocode:

This:

condcircle.kine.local.posx 01circle.kine.local.posx )

is equivalent to this:

if ( circle.kine.local.posx )
       
1
else
        
circle.kine.local.posx )


Replies: 1
/userdata/avatar/05g8hg338.gif

cond( circle.kine.local.posx > 0, 1, 1 + circle.kine.local.posx )

If “circle.kine.local.posx > 0” evaluates to true, then the cond statement evaluates to the value 1.

If “circle.kine.local.posx > 0” evaluates to false, then the cond statement evaluates to the value 1 + circle.kine.local.posx.

I understand how conditions work :) Just wrapping my head around this that is frustrating me.  In the example above I understand that:

0 (greater / less then)- if
1 - true
1 - false

Correct my math if I’m wrong, but if you add +circle.kine.local.posx which is a value of 0 then 0 + 1 normalizes to 0 that is why that must be added if the controller is at 0 it has no effect ?

So, if posx = 2, then you will get 3.
If posx = -1, then you will get 1.
If posx = 0, then you will get 1.

I didn’t understand this part, sorry !

What I’m trying to understand is taking from this tutorial, Part 2 Step 5.  My controller that I built has the same coordinates 0,0 (centre) -1,1 (top left) 1,1 (top right) -1,-1 (bottom left) 1, -1 (bottom right) ??

Example of my expression:

cond( <name of my controller>.kine.local.posx > 0, 1, 1 + <same name of controller>.kine.local.posx )

You must add the controller name afterwards just for it to normalize the value back to 0 if the controller is at the centre ("0") ?

Author: FalconCrest

Replied: 05 November 2010 06:33 AM  
avatar

quote



Replies: 0
avatar

So, if posx = 2, then you will get 3.
If posx = -1, then you will get 1.
If posx = 0, then you will get 1.

Sorry, I got that part wrong. It should be something like this:

If posx = -2, then you will get 1 + (-2) = -1
If posx = -4, then you will get -3
if posx = 0, then you will get 1.



Replies: 0
avatar

Hey christopher,

that tutorial is really showing its age now. Hopefully sometime I’ll get round to updating it.

In the meantime I have to admit I generally just use ‘link with’ instead of expressions these days - easier to set up! You can link all the various shapes you need to the one slider control just like normal expressions.

Hope this helps!



Replies: 0
avatar

I’ve just tried ‘link with’ in the shape manager to the custom controller and I can’t get it to work, how are you getting it to work ?!?! Are you creating a custom para set then linking that to the sliders ? I just want to know what method you’re doing I prefer to know the most optimized but useful methods !

The tutorial was good, I would have done it the method in the tutorial I’m just having a bit of problems understanding one or two parts of the tutorials math why I ask, it’s good to have a backup solution :)



Replies: 1
/img/forum/dark/default_avatar.png

In the shape manager in the animation tab there should be the list of shapes and the sliders to make them work - right click and link with on the green animation divot, and navigate to the controller you want to link to, and select the local translation in x or y. If you do this with the controller at 0 and the shape at 0, then make them both 1 and set relative values, then the last step is to make the animation curve that links them linear. (right click on the link with icon and open an animation editor, and select the curve and make linear)

Author: Matt Morris

Replied: 06 November 2010 03:01 PM  
avatar

Matt that is what I’ve done.  Currently I have the Shape Manager window open, I right click the divot and choose “link with” then the Para Connection Editor opens up that is where I’m stuck because in the driving source panel I can’t seem to make it show the shape I can only make the shape appear in the Driven Target, and even if I could make it appear in the Driving Source there is nothing to link with all I get is actionclip > (shape) with nothing to link. The Driven Target would have to be the custom controller I created.

If it’s at all possible and you could also explain your expression method so I can understand, I would greatly appreciate it. I just like something else to fall back on !



Replies: 2
/img/forum/dark/default_avatar.png

I think you’ve got it the wrong way round - the shape should be the driven target - the controller should be the driving source. Try it that way?

Author: Matt Morris

Replied: 07 November 2010 06:46 AM  
/img/forum/dark/default_avatar.png

I think you’ve got it the wrong way round - the shape should be the driven target - the controller should be the driving source. Try it that way?

Author: Matt Morris

Replied: 07 November 2010 10:51 AM  
avatar

...and even if I could make it appear in the Driving Source there is nothing to link with all I get is actionclip > (shape) with nothing to link. The Driven Target would have to be the custom controller I created.

Regardless, there is nothing to link it too in the parameter editor.



Replies: 1
/img/forum/dark/default_avatar.png

Do you have the controller selected when you click on the animation divot in the shape manager? Might help it show up…

Author: Matt Morris

Replied: 07 November 2010 09:38 PM  
avatar

Yes, same problem as I mentioned.



Replies: 0
avatar

Matt, I have figured out the expression :) I have another question, I hope you can answer ?



Replies: 0
avatar

Anyone knows if is possible translate or “remake” the RT materials of Zbrush into XSI ?

or some doc or tuto about RT shaders for SOFTIMAGE | XSI ?

thanks for advance,
wholesale pearl set



Replies: 0