Re: Transferring shape keys

2015-06-18 Thread Tim Crowson
Eric, if I understand you correctly, that's honestly what I'd rather do. 
Seems so much simpler to leave the shape keys in place and simply update 
whatever data they contain. But I simply don't know how to script this. 
I just haven't done much scripting with mesh attributes like this. How 
do I get the positions attribute from one shape key and apply it to another?


On 6/17/2015 6:21 PM, Eric Thivierge wrote:

Hey Tim,

Any reason you're not using scripting to regenerate these and not just 
use copy / paste? You can script the creation of the shape nodes and 
then copy the positions attribute over.


Another thing you could do is apply ICE Ops to copy the values of 
shapes on one mesh to another. Don't forget that ICE isn't always for 
Live operators, but you can design ops that are only there for 
utilities and then get frozen off. Especially when you use the 
ApplyICEOp() command which takes a compounds execute port (it has to 
have one) and connects it directly and then you can script the hook 
ups of get data nodes or you can fill in the reference inputs that 
point to the right objects / properties.


You can update data in shape keys through scripting or ICE.

Eric T.


Eric Thivierge
http://www.ethivierge.com

On Wed, Jun 17, 2015 at 3:48 PM, Tim Crowson 
tim.crow...@magneticdreams.com 
mailto:tim.crow...@magneticdreams.com wrote:


I'm working on a tool for updating shapeKeys inside a mesh's Shape
cluster. I can't use GATOR to transfer the shapes (that creates a
new Shape cluster anyway, which I don't want). My original intent
was to:
1. compare my rig model with my shapes model, storing any
animation or expressions on shape keys
2. delete shape keys out of my rig model
3. copy over the updated shape keys (same names) from the shapes model
4. re-apply anim/expressions

The problem I'm having is between steps 2 and 3. I am not sure
what the best method is for transferring shape keys. GATOR just
dumps the whole lot into a new Shape cluster, which I don't want.
So I'm falling back on Application.CopyPaste(). Now this works
fine when dragging and dropping via the mouse. But for some
reason, when firing the exact same command in code, it bombs and
throws an error on that command. However, if instead of deleting
specific shape keys, I delete the entire parent Shape cluster,
then CopyPaste() works just fine. It's almost like the CopyPaste()
command fails when fired from code AND a Shape cluster already
exists. But clearly, I can't just delete the Shape cluster, as we
might have custom shapes inside it that aren't in whatever model
we're sourcing from for the update..

Any ideas?

Honestly this would all be much easier (I think) if there was a
way to update point data inside a shape key, but I can't tell if
that's possible or not, hence my current method of deleting and
re-applying anim/expressions.

-- 


*Tim Crowson
*/Lead CG Artist/

*Magnetic Dreams, Inc.
*2525 Lebanon Pike, Bldg C, Suite 101, Nashville, TN 37214
*Ph* 615.885.6801 tel:615.885.6801 | *Fax* 615.889.4768
tel:615.889.4768 | www.magneticdreams.com
http://www.magneticdreams.com
tim.crow...@magneticdreams.com mailto:tim.crow...@magneticdreams.com

/
/




--
Signature




Re: Transferring shape keys

2015-06-18 Thread Eric Thivierge
If you get to the shape node through the object model you can then 
access the ClusterProperty (your shape key property that is on the 
cluster). From there its the .Elements.Array that stores the values. 
It'll return a Tuple of Tuples. 1 tuple per axis that will store the 
shape's delta from the base shape.


A simple script to do this is:

# Python
sel = Application.Selection
sel(1).Elements.Array = sel(0).Elements.Array

However Python won't be efficient with heavy meshes. Thus why i think 
ICE would be a better solution.


Through ICE you'd pull in the shape properties and connect their 
positions attributes.


Lastly to note, this also applies to weight maps as well.

Eric T.


On Thursday, June 18, 2015 9:33:33 AM, Tim Crowson wrote:

Eric, if I understand you correctly, that's honestly what I'd rather
do. Seems so much simpler to leave the shape keys in place and simply
update whatever data they contain. But I simply don't know how to
script this. I just haven't done much scripting with mesh attributes
like this. How do I get the positions attribute from one shape key and
apply it to another?

On 6/17/2015 6:21 PM, Eric Thivierge wrote:

Hey Tim,

Any reason you're not using scripting to regenerate these and not
just use copy / paste? You can script the creation of the shape nodes
and then copy the positions attribute over.

Another thing you could do is apply ICE Ops to copy the values of
shapes on one mesh to another. Don't forget that ICE isn't always for
Live operators, but you can design ops that are only there for
utilities and then get frozen off. Especially when you use the
ApplyICEOp() command which takes a compounds execute port (it has to
have one) and connects it directly and then you can script the hook
ups of get data nodes or you can fill in the reference inputs that
point to the right objects / properties.

You can update data in shape keys through scripting or ICE.

Eric T.


Eric Thivierge
http://www.ethivierge.com

On Wed, Jun 17, 2015 at 3:48 PM, Tim Crowson
tim.crow...@magneticdreams.com
mailto:tim.crow...@magneticdreams.com wrote:

I'm working on a tool for updating shapeKeys inside a mesh's
Shape cluster. I can't use GATOR to transfer the shapes (that
creates a new Shape cluster anyway, which I don't want). My
original intent was to:
1. compare my rig model with my shapes model, storing any
animation or expressions on shape keys
2. delete shape keys out of my rig model
3. copy over the updated shape keys (same names) from the shapes
model
4. re-apply anim/expressions

The problem I'm having is between steps 2 and 3. I am not sure
what the best method is for transferring shape keys. GATOR just
dumps the whole lot into a new Shape cluster, which I don't want.
So I'm falling back on Application.CopyPaste(). Now this works
fine when dragging and dropping via the mouse. But for some
reason, when firing the exact same command in code, it bombs and
throws an error on that command. However, if instead of deleting
specific shape keys, I delete the entire parent Shape cluster,
then CopyPaste() works just fine. It's almost like the
CopyPaste() command fails when fired from code AND a Shape
cluster already exists. But clearly, I can't just delete the
Shape cluster, as we might have custom shapes inside it that
aren't in whatever model we're sourcing from for the update..

Any ideas?

Honestly this would all be much easier (I think) if there was a
way to update point data inside a shape key, but I can't tell if
that's possible or not, hence my current method of deleting and
re-applying anim/expressions.

--

*Tim Crowson
*/Lead CG Artist/

*Magnetic Dreams, Inc.
*2525 Lebanon Pike, Bldg C, Suite 101, Nashville, TN 37214
*Ph* 615.885.6801 tel:615.885.6801 | *Fax* 615.889.4768
tel:615.889.4768 | www.magneticdreams.com
http://www.magneticdreams.com
tim.crow...@magneticdreams.com
mailto:tim.crow...@magneticdreams.com

/
/




--
Signature






Re: Transferring shape keys

2015-06-18 Thread Tim Crowson
Yeah I see what you're saying about Elements.Array being a bit sluggish. 
Doesn't seem to take much to slow it down. Really appreciate your help 
in this... anyone of these options will save me a lot of headaches. Thanks!

-Tim

On 6/18/2015 9:03 AM, Eric Thivierge wrote:
As a last addition to this, it's also worth mentioning you can query 
ICEAttribute values directly from scripting too using the 
ICEAttribute.DataArray and you may be able to use that more 
efficiently than the Elements.Array


Eric T

On 6/18/2015 9:49 AM, Eric Thivierge wrote:
If you get to the shape node through the object model you can then 
access the ClusterProperty (your shape key property that is on the 
cluster). From there its the .Elements.Array that stores the values. 
It'll return a Tuple of Tuples. 1 tuple per axis that will store the 
shape's delta from the base shape.


A simple script to do this is:

# Python
sel = Application.Selection
sel(1).Elements.Array = sel(0).Elements.Array

However Python won't be efficient with heavy meshes. Thus why i think 
ICE would be a better solution.


Through ICE you'd pull in the shape properties and connect their 
positions attributes.


Lastly to note, this also applies to weight maps as well.

Eric T.


On Thursday, June 18, 2015 9:33:33 AM, Tim Crowson wrote:

Eric, if I understand you correctly, that's honestly what I'd rather
do. Seems so much simpler to leave the shape keys in place and simply
update whatever data they contain. But I simply don't know how to
script this. I just haven't done much scripting with mesh attributes
like this. How do I get the positions attribute from one shape key and
apply it to another?

On 6/17/2015 6:21 PM, Eric Thivierge wrote:

Hey Tim,

Any reason you're not using scripting to regenerate these and not
just use copy / paste? You can script the creation of the shape nodes
and then copy the positions attribute over.

Another thing you could do is apply ICE Ops to copy the values of
shapes on one mesh to another. Don't forget that ICE isn't always for
Live operators, but you can design ops that are only there for
utilities and then get frozen off. Especially when you use the
ApplyICEOp() command which takes a compounds execute port (it has to
have one) and connects it directly and then you can script the hook
ups of get data nodes or you can fill in the reference inputs that
point to the right objects / properties.

You can update data in shape keys through scripting or ICE.

Eric T.


Eric Thivierge
http://www.ethivierge.com

On Wed, Jun 17, 2015 at 3:48 PM, Tim Crowson
tim.crow...@magneticdreams.com
mailto:tim.crow...@magneticdreams.com wrote:

I'm working on a tool for updating shapeKeys inside a mesh's
Shape cluster. I can't use GATOR to transfer the shapes (that
creates a new Shape cluster anyway, which I don't want). My
original intent was to:
1. compare my rig model with my shapes model, storing any
animation or expressions on shape keys
2. delete shape keys out of my rig model
3. copy over the updated shape keys (same names) from the shapes
model
4. re-apply anim/expressions

The problem I'm having is between steps 2 and 3. I am not sure
what the best method is for transferring shape keys. GATOR just
dumps the whole lot into a new Shape cluster, which I don't want.
So I'm falling back on Application.CopyPaste(). Now this works
fine when dragging and dropping via the mouse. But for some
reason, when firing the exact same command in code, it bombs and
throws an error on that command. However, if instead of deleting
specific shape keys, I delete the entire parent Shape cluster,
then CopyPaste() works just fine. It's almost like the
CopyPaste() command fails when fired from code AND a Shape
cluster already exists. But clearly, I can't just delete the
Shape cluster, as we might have custom shapes inside it that
aren't in whatever model we're sourcing from for the update..

Any ideas?

Honestly this would all be much easier (I think) if there was a
way to update point data inside a shape key, but I can't tell if
that's possible or not, hence my current method of deleting and
re-applying anim/expressions.

--

*Tim Crowson
*/Lead CG Artist/

*Magnetic Dreams, Inc.
*2525 Lebanon Pike, Bldg C, Suite 101, Nashville, TN 37214
*Ph* 615.885.6801 tel:615.885.6801 | *Fax* 615.889.4768
tel:615.889.4768 | www.magneticdreams.com
http://www.magneticdreams.com
tim.crow...@magneticdreams.com
mailto:tim.crow...@magneticdreams.com

/
/




--
Signature







--
Signature

*Tim Crowson
*/Lead CG Artist/

*Magnetic Dreams, Inc.
*2525 Lebanon Pike, Bldg C, Suite 101, Nashville, TN 37214
*Ph*  615.885.6801 | *Fax*  615.889.4768 | www.magneticdreams.com
tim.crow...@magneticdreams.com

/Confidentiality Notice: This email, including attachments, is 
confidential

Re: Transferring shape keys

2015-06-18 Thread Eric Thivierge
As a last addition to this, it's also worth mentioning you can query 
ICEAttribute values directly from scripting too using the 
ICEAttribute.DataArray and you may be able to use that more efficiently 
than the Elements.Array


Eric T

On 6/18/2015 9:49 AM, Eric Thivierge wrote:
If you get to the shape node through the object model you can then 
access the ClusterProperty (your shape key property that is on the 
cluster). From there its the .Elements.Array that stores the values. 
It'll return a Tuple of Tuples. 1 tuple per axis that will store the 
shape's delta from the base shape.


A simple script to do this is:

# Python
sel = Application.Selection
sel(1).Elements.Array = sel(0).Elements.Array

However Python won't be efficient with heavy meshes. Thus why i think 
ICE would be a better solution.


Through ICE you'd pull in the shape properties and connect their 
positions attributes.


Lastly to note, this also applies to weight maps as well.

Eric T.


On Thursday, June 18, 2015 9:33:33 AM, Tim Crowson wrote:

Eric, if I understand you correctly, that's honestly what I'd rather
do. Seems so much simpler to leave the shape keys in place and simply
update whatever data they contain. But I simply don't know how to
script this. I just haven't done much scripting with mesh attributes
like this. How do I get the positions attribute from one shape key and
apply it to another?

On 6/17/2015 6:21 PM, Eric Thivierge wrote:

Hey Tim,

Any reason you're not using scripting to regenerate these and not
just use copy / paste? You can script the creation of the shape nodes
and then copy the positions attribute over.

Another thing you could do is apply ICE Ops to copy the values of
shapes on one mesh to another. Don't forget that ICE isn't always for
Live operators, but you can design ops that are only there for
utilities and then get frozen off. Especially when you use the
ApplyICEOp() command which takes a compounds execute port (it has to
have one) and connects it directly and then you can script the hook
ups of get data nodes or you can fill in the reference inputs that
point to the right objects / properties.

You can update data in shape keys through scripting or ICE.

Eric T.


Eric Thivierge
http://www.ethivierge.com

On Wed, Jun 17, 2015 at 3:48 PM, Tim Crowson
tim.crow...@magneticdreams.com
mailto:tim.crow...@magneticdreams.com wrote:

I'm working on a tool for updating shapeKeys inside a mesh's
Shape cluster. I can't use GATOR to transfer the shapes (that
creates a new Shape cluster anyway, which I don't want). My
original intent was to:
1. compare my rig model with my shapes model, storing any
animation or expressions on shape keys
2. delete shape keys out of my rig model
3. copy over the updated shape keys (same names) from the shapes
model
4. re-apply anim/expressions

The problem I'm having is between steps 2 and 3. I am not sure
what the best method is for transferring shape keys. GATOR just
dumps the whole lot into a new Shape cluster, which I don't want.
So I'm falling back on Application.CopyPaste(). Now this works
fine when dragging and dropping via the mouse. But for some
reason, when firing the exact same command in code, it bombs and
throws an error on that command. However, if instead of deleting
specific shape keys, I delete the entire parent Shape cluster,
then CopyPaste() works just fine. It's almost like the
CopyPaste() command fails when fired from code AND a Shape
cluster already exists. But clearly, I can't just delete the
Shape cluster, as we might have custom shapes inside it that
aren't in whatever model we're sourcing from for the update..

Any ideas?

Honestly this would all be much easier (I think) if there was a
way to update point data inside a shape key, but I can't tell if
that's possible or not, hence my current method of deleting and
re-applying anim/expressions.

--

*Tim Crowson
*/Lead CG Artist/

*Magnetic Dreams, Inc.
*2525 Lebanon Pike, Bldg C, Suite 101, Nashville, TN 37214
*Ph* 615.885.6801 tel:615.885.6801 | *Fax* 615.889.4768
tel:615.889.4768 | www.magneticdreams.com
http://www.magneticdreams.com
tim.crow...@magneticdreams.com
mailto:tim.crow...@magneticdreams.com

/
/




--
Signature







Re: Transferring shape keys

2015-06-18 Thread Matt Lind
The reason it's slow is because you're accessing the ClusterProperties through 
the selection list triggering additional cascading callbacks.  If you use 
direct references to the clusterproperty objects, copying the data will go much 
faster.  The GridData object is useful here as it can make coding simpler while 
abstracting away from the overhead of Python.  There's also no need to use ICE 
for this task:

example (JScript):

var oPointPositionData = XSIFactory.CreateGridData();
oPointPositionData.ColumnCount = 3;

var oSourceClusterProperty = Selection(0);
var oTargetClusterProperty = Selection(1);

// Copy point positions from source cluster property
oPointPositionData.Data = oSourceClusterProperty.Elements.Array;

// Paste point positions to target cluster property
oTargetClusterProperty.Elements.Array = oPointPositionData.Data;


This, of course, assumes point counts between source and target cluster 
properties are identical.

Matt







Date: Thu, 18 Jun 2015 09:49:13 -0400
From: Eric Thivierge ethivie...@hybride.com
Subject: Re: Transferring shape keys
To: softimage@listproc.autodesk.com

If you get to the shape node through the object model you can then 
access the ClusterProperty (your shape key property that is on the 
cluster). From there its the .Elements.Array that stores the values. 
It'll return a Tuple of Tuples. 1 tuple per axis that will store the 
shape's delta from the base shape.

A simple script to do this is:

# Python
sel = Application.Selection
sel(1).Elements.Array = sel(0).Elements.Array

However Python won't be efficient with heavy meshes. Thus why i think 
ICE would be a better solution.

Through ICE you'd pull in the shape properties and connect their 
positions attributes.

Lastly to note, this also applies to weight maps as well.

Eric T.


On Thursday, June 18, 2015 9:33:33 AM, Tim Crowson wrote:
 Eric, if I understand you correctly, that's honestly what I'd rather
 do. Seems so much simpler to leave the shape keys in place and simply
 update whatever data they contain. But I simply don't know how to
 script this. I just haven't done much scripting with mesh attributes
 like this. How do I get the positions attribute from one shape key and
 apply it to another?

 On 6/17/2015 6:21 PM, Eric Thivierge wrote:
 Hey Tim,

 Any reason you're not using scripting to regenerate these and not
 just use copy / paste? You can script the creation of the shape nodes
 and then copy the positions attribute over.

 Another thing you could do is apply ICE Ops to copy the values of
 shapes on one mesh to another. Don't forget that ICE isn't always for
 Live operators, but you can design ops that are only there for
 utilities and then get frozen off. Especially when you use the
 ApplyICEOp() command which takes a compounds execute port (it has to
 have one) and connects it directly and then you can script the hook
 ups of get data nodes or you can fill in the reference inputs that
 point to the right objects / properties.

 You can update data in shape keys through scripting or ICE.

 Eric T.

 
 Eric Thivierge
 http://www.ethivierge.com

 On Wed, Jun 17, 2015 at 3:48 PM, Tim Crowson
 tim.crow...@magneticdreams.com
 mailto:tim.crow...@magneticdreams.com wrote:

 I'm working on a tool for updating shapeKeys inside a mesh's
 Shape cluster. I can't use GATOR to transfer the shapes (that
 creates a new Shape cluster anyway, which I don't want). My
 original intent was to:
 1. compare my rig model with my shapes model, storing any
 animation or expressions on shape keys
 2. delete shape keys out of my rig model
 3. copy over the updated shape keys (same names) from the shapes
 model
 4. re-apply anim/expressions

 The problem I'm having is between steps 2 and 3. I am not sure
 what the best method is for transferring shape keys. GATOR just
 dumps the whole lot into a new Shape cluster, which I don't want.
 So I'm falling back on Application.CopyPaste(). Now this works
 fine when dragging and dropping via the mouse. But for some
 reason, when firing the exact same command in code, it bombs and
 throws an error on that command. However, if instead of deleting
 specific shape keys, I delete the entire parent Shape cluster,
 then CopyPaste() works just fine. It's almost like the
 CopyPaste() command fails when fired from code AND a Shape
 cluster already exists. But clearly, I can't just delete the
 Shape cluster, as we might have custom shapes inside it that
 aren't in whatever model we're sourcing from for the update..

 Any ideas?

 Honestly this would all be much easier (I think) if there was a
 way to update point data inside a shape key, but I can't tell if
 that's possible or not, hence my current method of deleting and
 re-applying anim/expressions.

 --

 *Tim Crowson
 */Lead CG Artist/

 *Magnetic Dreams, Inc

Re: Transferring shape keys

2015-06-17 Thread Eric Thivierge
Hey Tim,

Any reason you're not using scripting to regenerate these and not just use
copy / paste? You can script the creation of the shape nodes and then copy
the positions attribute over.

Another thing you could do is apply ICE Ops to copy the values of shapes on
one mesh to another. Don't forget that ICE isn't always for Live operators,
but you can design ops that are only there for utilities and then get
frozen off. Especially when you use the ApplyICEOp() command which takes a
compounds execute port (it has to have one) and connects it directly and
then you can script the hook ups of get data nodes or you can fill in the
reference inputs that point to the right objects / properties.

You can update data in shape keys through scripting or ICE.

Eric T.


Eric Thivierge
http://www.ethivierge.com

On Wed, Jun 17, 2015 at 3:48 PM, Tim Crowson tim.crow...@magneticdreams.com
 wrote:

  I'm working on a tool for updating shapeKeys inside a mesh's Shape
 cluster. I can't use GATOR to transfer the shapes (that creates a new Shape
 cluster anyway, which I don't want). My original intent was to:
 1. compare my rig model with my shapes model, storing any animation or
 expressions on shape keys
 2. delete shape keys out of my rig model
 3. copy over the updated shape keys (same names) from the shapes model
 4. re-apply anim/expressions

 The problem I'm having is between steps 2 and 3. I am not sure what the
 best method is for transferring shape keys. GATOR just dumps the whole lot
 into a new Shape cluster, which I don't want. So I'm falling back on
 Application.CopyPaste(). Now this works fine when dragging and dropping via
 the mouse. But for some reason, when firing the exact same command in code,
 it bombs and throws an error on that command. However, if instead of
 deleting specific shape keys, I delete the entire parent Shape cluster,
 then CopyPaste() works just fine. It's almost like the CopyPaste() command
 fails when fired from code AND a Shape cluster already exists. But clearly,
 I can't just delete the Shape cluster, as we might have custom shapes
 inside it that aren't in whatever model we're sourcing from for the update..

 Any ideas?

 Honestly this would all be much easier (I think) if there was a way to
 update point data inside a shape key, but I can't tell if that's possible
 or not, hence my current method of deleting and re-applying
 anim/expressions.

 --




 *Tim Crowson **Lead CG Artist*


 *Magnetic Dreams, Inc. *2525 Lebanon Pike, Bldg C, Suite 101, Nashville,
 TN 37214
 *Ph*  615.885.6801 | *Fax*  615.889.4768 | www.magneticdreams.com
 tim.crow...@magneticdreams.com