I apologize in advance for not having a clear subject for this topic, but
in this case I believe the two things are strictly related...
I'm having a huge problem adding new targets on a blendShape node.
Every time I try to add a new target to one of my blendShape nodes, it
fails and gives me this error:
# Error: line 1: Specified blendShape not found in history of baseShape. #
After researching for a few days, I've found out that the problem actually
happens only when using a parallelBlender.
It seems as if Maya is not able to find a relationship between the base
mesh and the blendShape nodes beyond the parallelBlender.
So I jumped into the GroupId/GroupParts/Set jungle and I checked all the
connections, but they were right.
I tried using maya.cmds, maya api's' (MFnBlendShape.addTarget()), pymel,
but none seem to work.
So I decided to take a more 'hacky' approach and wrote a function that
temporarily connect the node I want directly to the 'baseShape', add the
target (it works!!) and then restore the original connections.
I'm happy with the result, but I wanted this function to be fired off only
when the normal blendShape.addTarget() doesn't work.
The easiest way of doing this is to
bs_node.addTarget('baseShape', 1, 'targetShape', 1)
Problem is: it doesn't work. When I run this code I still get the same
error in the script editor. The error is not recognized as such by Python,
thus not caught by the 'except'. Moreover, the execution of the script
keeps going: if you add a print statement after the addTarget, it will be
printed in the log!
Apparently there's a MEL 'catch' and 'catchQuiet' command supposed to catch
Maya errors, but is not available for Python (and not embedded into the
Has anyone had a similar situation? It's so frustrating when things just
don't work the way they should after you tried everything...
So, summing up:
- i believe the two topics are strictly related, cause if I try to catch a
normal cmds.error, it is caught regularly
- is there a non hacky solution that you know of, to solve the addTarget
- what is the proper way to catch an internal Maya Error (which is not a
Any help is greatly appreciated!
You received this message because you are subscribed to the Google Groups
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email
To view this discussion on the web visit
For more options, visit https://groups.google.com/d/optout.