Null drive another null or point cloud - Parenting related

Discussions about SOFTIMAGEs© Interactive Creative Environment©
Post Reply
Nick3d
Posts: 71
Joined: 10 Aug 2011, 14:16

Null drive another null or point cloud - Parenting related

Post by Nick3d » 01 Aug 2013, 19:41

Hello everyone,
Being really bad at ICE I'm tryong to figure out a solution, here it is:

I have an animated called null1 and I want null2 to be driven ( in X and Y ) by the null1, but keeping the original distance between the two
Basically I need to do a Constrain > position without having null1 to go in the exact same place where null2 is, but I would like to multiply the actual X and Y movement by a specific number, so that I can multiply the X and Y movement and have the null2 to move less/more than null1 ( basically I need to modulate the actual movement )

I'm experimenting with Matrix and scalar, but I always have mismatch context whenever I try to hook up the X and Y global.kine of null1 to the global.kine of null2

Any help please?

Thanks

grahamef
Posts: 281
Joined: 23 Jun 2009, 21:01

Re: Null drive another null or point cloud - Parenting related

Post by grahamef » 01 Aug 2013, 20:35

See the attached tree.

Just to note -- Don't try to get null2's current values and use them to drive new values or you risk creating a dependancy cycle. Also, the order matters when multiplying matrices.
Attachments
poseconstrain_with_offset.png

Nick3d
Posts: 71
Joined: 10 Aug 2011, 14:16

Re: Null drive another null or point cloud - Parenting related

Post by Nick3d » 02 Aug 2013, 10:05

grahamef wrote:See the attached tree.

Just to note -- Don't try to get null2's current values and use them to drive new values or you risk creating a dependancy cycle. Also, the order matters when multiplying matrices.
Thanks, now is a bit clear...

I'm thinking a workaround ( can't experimenting right now ) thas is:
Null1: animated null
Null2: driven null

Get the Null2 current position ( in order that is doesn't jump in the same position of the Null1 ) and add to its position the values ( multiplied by a custom value ) of the Null1 translation in X and Y ( doing those separately, since X will be multiplied by a different value )

The thing that I want to achieve is "Null2, stay where you are in space, but move in X and Y according to the Null1 translation added to your original position"

So, adding null2 original position to null1 translation could be the answer?
Thanks grahamef for the compound :)

grahamef
Posts: 281
Joined: 23 Jun 2009, 21:01

Re: Null drive another null or point cloud - Parenting related

Post by grahamef » 02 Aug 2013, 17:46

Nick3d wrote: Get the Null2 current position ( in order that is doesn't jump in the same position of the Null1 ) and add to its position the values ( multiplied by a custom value ) of the Null1 translation in X and Y ( doing those separately, since X will be multiplied by a different value )
Nope, that's a cycle right there: Null2's position being used to set Null2's position. If something forces a refresh of the scene then it will update Null2's position based not on its original position but on its new position, and then if there's another refresh it will use the new new position, and so on.

Use a third null to define the "base" offset you want, and calculate the scaled offsets based on that.

Nick3d
Posts: 71
Joined: 10 Aug 2011, 14:16

Re: Null drive another null or point cloud - Parenting related

Post by Nick3d » 05 Aug 2013, 14:56

Thanks again for the tip

Actually I was thinking something a bit different: using the driven null local coordinate ( there is a good explanation on how to get local coordinates ) and the animated null local coordinates and parent them using 3d vector to scalar, so I can manage X, Y and Z from there by multiplying the value I want
I experimented a bit but since now I didn't get the result I want
My main problem right now is to "tell" the driven null to stay in the 0 position when is parented to the animated null, and move on the axis by the animated null accordingly to its local movement

Maybe dumb question but hey, better ask: if I just use the normal "parent" constrain I can see that the driven null stays in the same position and it will move accordingly to the animated null and that is exactly what I want, except I would like to control the "amount" of the vertical and horizontal movement, by multiplying each value ( 0.5*x movement of the animated null )
It is possible to use a custom parameter set to do that? has been a while since I've used them so I'm not totally sure if this could be a easier solution

grahamef
Posts: 281
Joined: 23 Jun 2009, 21:01

Re: Null drive another null or point cloud - Parenting related

Post by grahamef » 05 Aug 2013, 19:21

If I understand you correctly...

Parent a third null to Null1 to use as reference for the base offset.

Get Null1's global kine, convert to separate SRT, break the translation apart into separate XYZ. Multiply X and Y by whatever you want, then put the XYZ back into a vector, and the vector back into a matrix with the original scale and rotation.

Get the reference null's local kine, multiply by the matrix you calculated above (in that order), and set Null2's global kine.

Nick3d
Posts: 71
Joined: 10 Aug 2011, 14:16

Re: Null drive another null or point cloud - Parenting related

Post by Nick3d » 06 Aug 2013, 07:59

Grahamef thanks again for your advices

I tried to manage everything in ICE but ( probably because of my lack of knowledge ) I ended up using the expression editor, doing more or less what you described below, and it works properly!

Thanks again

Pancho
Posts: 659
Joined: 19 Sep 2010, 11:28

Re: Null drive another null or point cloud - Parenting related

Post by Pancho » 06 Aug 2013, 10:33

Wow! That should be so much easier in ICE. But good to know that it's possible with expressions.

Nick3d
Posts: 71
Joined: 10 Aug 2011, 14:16

Re: Null drive another null or point cloud - Parenting related

Post by Nick3d » 06 Aug 2013, 10:53

Pancho wrote:Wow! That should be so much easier in ICE. But good to know that it's possible with expressions.
I read that there are some problems with the setup of local coordinates and overall using expressions is a quick and dirty solution

I would love to do a proper setup using ICE and get the same result ( even because this setup will be used on 30-40 nulls ) but I think I will just spend 1 hour doing the setup and then save it as a model, in order to be re-used as I wish....time consuming, but I'll do it once then I can re-apply the same model to another mesh

I tought that it would be easier, but damn I tried so many times that I gave up because of frustration, expressions are a bit more familiar...I guess its time to start studying ICE properly :)

Pancho
Posts: 659
Joined: 19 Sep 2010, 11:28

Re: Null drive another null or point cloud - Parenting related

Post by Pancho » 06 Aug 2013, 11:01

You should! One of the "golden rules" so far I've come across is to NEVER set anything on something else. Always have something look for data on something else and then apply it to itself. Otherwise it gets messy. Really messy!

Nick3d
Posts: 71
Joined: 10 Aug 2011, 14:16

Re: Null drive another null or point cloud - Parenting related

Post by Nick3d » 06 Aug 2013, 11:57

Pancho wrote:You should! One of the "golden rules" so far I've come across is to NEVER set anything on something else. Always have something look for data on something else and then apply it to itself. Otherwise it gets messy. Really messy!
MMmmhhh...this is a bit vague...by that I mean that usually I follow Paul Smith's tutorials on ICE, they're well explained and I'm learning quite a lot, but far from a daily "problem solving" method

The "set anything on something else", maybe I'm misinterpreting, but you mean about set location that can be tricky?
Because from what I've seen since now it is usually an ICE tree on a mesh that gather the information on another mesh, and then set the mesh itself...so isn't this "setting on something else"?

Just asking, so I can clearly see the difference ;)

Pancho
Posts: 659
Joined: 19 Sep 2010, 11:28

Re: Null drive another null or point cloud - Parenting related

Post by Pancho » 06 Aug 2013, 12:11

If you have several objects with ICE trees or without, one object should never tell another object it's values, positions, etc. Communication between objects should always happen in a way that each objects "asks" for its values which are stored somewhere else and then applies these settings on itself.

Null1 shouldn't tell Null2 where to go. Instead Null1 should have an attribute ready for Null2 and Null2 looks this value up on Null1 and then uses this value by setting something on itself with a "Set Data" node, e.g. it's position. Null2 could even use this value for further calculations before setting it.

Nick3d
Posts: 71
Joined: 10 Aug 2011, 14:16

Re: Null drive another null or point cloud - Parenting related

Post by Nick3d » 06 Aug 2013, 13:01

Pancho wrote:If you have several objects with ICE trees or without, one object should never tell another object it's values, positions, etc. Communication between objects should always happen in a way that each objects "asks" for its values which are stored somewhere else and then applies these settings on itself.

Null1 shouldn't tell Null2 where to go. Instead Null1 should have an attribute ready for Null2 and Null2 looks this value up on Null1 and then uses this value by setting something on itself with a "Set Data" node, e.g. it's position. Null2 could even use this value for further calculations before setting it.
Ok, thats quite clear, thing is I usually always put an ICE tree just on an object "pretending" to gather all the information I need directly there, but putting another ICE tree on another object and reference that value to the other ICE tree I realize that it is better organized and should do the trick

I think I'll do a bit of experiments later this afternoon

Thanks again of the tips Pancho :)

Post Reply

Who is online

Users browsing this forum: brandwatch [Bot] and 36 guests