Hey there,
Let me setup a hypothetical scenario involving two Mesh/Polygon shapes. Shape A needs to look like Shape B which will be executed in a simple MEL procedure.
I’m utilizing the nifty trick of forcing Shape A to update its “look” from Shape B based on the outMesh-to-inMesh attributes. However, I noticed that Shape A will not update if Shape B is deleted after the connection is made within the procedure.
Is there anyway to force an update during a MEL procedure? I looked into and used the dgdirty command but it didn’t seem to work. I could be using it incorrectly of course.
The only solution I got working was to use the “evalDeferred” command in front of the “delete Shape B” command. However, this does not work in my actual code block that I’m writing. There are many other things going on (which I’d prefer to keep private for the time being) that could be keeping the shape from updating.
Just wondering if anyone might have a solution to force an update during a MEL procedure.
Thanks in advance!
Create a box named “obj1”.
Create a sphere named “obj2”.
This code will NOT work:
{
string $shape1 = "objShape1";
string $shape2 = "objShape2";
connectAttr -f ($shape1 + ".outMesh") ($shape2 + ".inMesh");
delete "obj1";
}
This code will work:
{
string $shape1 = "objShape1";
string $shape2 = "objShape2";
connectAttr -f ($shape1 + ".outMesh") ($shape2 + ".inMesh");
evalDeferred "delete obj1";
}
