PDA

View Full Version : Deleting 'weight' attributes from a blendshape node. (static attribs)


marcuso
01-08-2011, 12:02 PM
I've noticed that when you query a blendshape node for a weight index that doesn't exist, it goes ahead and creates it for you. But that action doesn't seem to get into the undo queue so removing it seems like a challange.

the deleteAttr command seems only capable of removing dynamic attributes, however the weight attribute is apparently a static one and maya isn't too happy about removing it.

Anyone know how I could go about to remove a static variable? A static compound variable even.. An easier way than recreating the node and reconnecting the connections.

p, li { white-space: pre-wrap; } RuntimeError: Cannot delete static attribute 'blendShape1.weight[3]' from node 'blendShape1'.

r4inm4ker
02-17-2011, 02:31 AM
I'd like to know the solution as well, if there's any.


Jefri

Keilun
02-17-2011, 05:54 PM
You want to use the removeMultiInstance command. This should work for any static/dynamic multi (array) attributes. I forget which version of Maya this was added in, but it was recent (within the last few years), so depending on how old your Maya is, it may not exist in your version.

r4inm4ker
02-21-2011, 04:17 AM
You want to use the removeMultiInstance command. This should work for any static/dynamic multi (array) attributes. I forget which version of Maya this was added in, but it was recent (within the last few years), so depending on how old your Maya is, it may not exist in your version.

How would I use this removeMultiInstance command ? I've tried deleting the blendshape input connections, and then tried removeMultiInstance blendhape1.weight[0] , removeMultiInstance blendhape1.weight[1], etc but it seems to have no effect at all, the bs attribute is still there.

Keilun
02-22-2011, 01:57 PM
removeMultiInstance removes the array element, not the entire attribute itself, which from what I can tell is what the OP was asking for. It sounds like you want something different? Can you elaborate on what you want? You cannot delete static attributes. It is impossible and I cannot see why you would want to.

Also, once you remove a multi instance, there really is no way to verify it since if you query it, it will re-instantiate it. You just have to trust that it's not there. Maybe if you elaborate on why you need it gone, we can look at solving that issue since I suspect you might be looking at things the wrong way.

r4inm4ker
02-23-2011, 12:14 AM
Well, what I actually want to do is remove some of the unused weights in blendshape node. For example I've created 3 head blendshapes (ie. mouth_a, mouth_b, and mouth_c), and then realize one of them (mouth_b) was redundant, so I needed to remove it from the weight list, but failed to do so using either delete attribute or disconnectAttr. The (mouth_b) weight was still there in the channel box. I think it's pretty common problem, but haven't found any solution so far other than rebuilding the blendshape node (which i want to avoid if possible).

I hope my question is clear.

Thanks,
Jefri

Keilun
02-23-2011, 02:41 PM
I don't recall all the details of what needs to be disconnected/deleted to remove a blend target from a blendShape. But I don't think you need to:

blendShape has a flag -rm that will remove the geometries listed in the -g flag from the blendShape node. Perhaps try that?

blendShape -e -rm -g "mouth_b" yourBlendShapeNodeName;

r4inm4ker
02-25-2011, 01:09 AM
Well, I tried those flags as you suggested, but it seems to have no effect at all, or maybe i'm not using it correctly.

What I did:
1. create a mesh, and some blendshape targets.( mouth_a, mouth_b, mouth_c). The blendshape node is called blendshape1.
2. I executed

blendShape -e -rm -g "mouth_b" blendshape1;


But the attribute "mouth_b" wasn't removed at all.

edit : forgot to add that i was testing it on Maya2009 & 2011 linux.

Keilun
02-25-2011, 07:15 PM
Hey,

I just confirmed this is a bug. You should report this through your support channel as well. It will give it have more visibility, even if it already is logged. In case you're interested, the internal bug #374749 (Removing a blendShape target can leave useless attr name in AE/channelBox).

r4inm4ker
03-01-2011, 12:32 AM
Got it. Thanks for confirming this problem!

CGTalk Moderation
03-01-2011, 12:32 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.