Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

create blend shapes

create blend shapes

rehab_salem83
Enthusiast Enthusiast
1,304 Views
12 Replies
Message 1 of 13

create blend shapes

rehab_salem83
Enthusiast
Enthusiast

Hi all, i have a question please, i have a character with blend shapes on Maya and i had to separate the teeth and eyes from the character mesh and after that i go to deform> blend shapes and i got the error message: // Error: line 0: No deformable objects selected.

and i know it's because the mesh is no longer the same count of vertex , but is there any option to make the blend shapes works to the mesh without teeth and eyes ?!

 

0 Likes
Accepted solutions (1)
1,305 Views
12 Replies
Replies (12)
Message 2 of 13

mcw0
Advisor
Advisor

why not remove the teeth and eyes from the blendshapes as well?

0 Likes
Message 3 of 13

rehab_salem83
Enthusiast
Enthusiast

the blend shapes about 1000 shapes , they're a lot , is there a way to separate eyes, teeth and gums from all shapes in an easy way, or i have to select every single shape?!

Note: the eyes and teeth can separate but gums i should select the faces to extract from the mesh 

0 Likes
Message 4 of 13

mcw0
Advisor
Advisor

This is where the power of scripting comes in.  You can loop through your 1000 shapes and repeat the same operation.  You say you can separate the eyes and teeth.  Ok, that's "polySeparate".  To extract the gums, since it's a blendshape, they are the same faces for all the shapes.  Again, perfect for scripting.  "polyChipOff" with a "polySeparate" chaser.  🙂

Message 5 of 13

mcw0
Advisor
Advisor

If you are new to scripting, take note of what's displayed in the Script Editor window when you manually do the steps you want.  Copy and paste those into a "for loop".  You can google "for loops" to see how they work.  The logic is as follows.

//  Select all the objects that you want to act on

 

string $objects[] = `ls -selection`;

//  For loop

for($object in $objects)

{

    //  Separate eyes and teeth

    string $results[] = `polySeparate -ch 0 $object`;

    //  Take note of which resulting mesh has the gums

    //  Extract gums...in this example, I'm saying the first resulting mesh (index 0) contains the gums

    //  And the gums are faces 0 through 10.

    polyChipOff -ch 0 ($results[0]+".f[0:10]");

    polySeparate -ch 0 $results[0];

}

Message 6 of 13

rehab_salem83
Enthusiast
Enthusiast

wow thank you so much, this will help me a lot , but unfortunately i have no experience on scripting !

i didn't get what you said about (For loops) , i googled it but i didn't get what i should do exactly ! and what i should write on script to do the loop!

and i need after these steps to delete history from all shapes and delete the poly separate parts and just keep the blend shape clean , so i was wondering if i could send you the file with just one shape and kindly tell me what to do exactly, your help will really matter, Thank you   

0 Likes
Message 7 of 13

mcw0
Advisor
Advisor
Accepted solution

Unfortunately, I won't be able to open your file.

If you look at my example, the parts you need to change are the index for "$results".  And the indices for your gum faces.  Ignoring any scripting, if you go through the process manually, take note of the step where you separate the eyes and teeth.  What is the name of the resulting mesh that contains the gums?

 

Now look in the Script Editor window.  In the upper text field, look from the bottom up for a line that starts with "polySeparate".  Now look at the line just under that.  It will start with "//  Result:".  Look for the name of the mesh with the gums and count which name it is on that line.  Your index will be that number minus 1.  For instance, if it is the second name on the line, then your index is 1.


 

In my example script, replace "$results[0]" with "$results[1]".

Now select the faces that make up the gums and extract them.  Again, in the Script Editor window, in the upper text field, look from bottom up for a line starting with "polyChipOff".  Note towards the end of the line, it will have something with the name of the gum mesh and ".f[]".  There will be some numbers and a colon between the brackets.  Those are your faces.  I'm hoping there's only one set of "f.[]".  Let me know if there are more than one and I'll tell you how to deal with that.  

In my script, replace my "0:10" with the numbers you found.  That should be it.  Just select all the remaining meshes that you need to act on and run the script.

Message 8 of 13

rehab_salem83
Enthusiast
Enthusiast

ok great thank you so much i will do the process and tell you the updates.

0 Likes
Message 9 of 13

007068549
Community Visitor
Community Visitor

If it was me I would just do the blendshape heads over again without teeth and eyes and rack it up to a learning experience.  

0 Likes
Message 10 of 13

rehab_salem83
Enthusiast
Enthusiast

blend shapes are about 1000 shapes and it's exporting from DAZ as it is , it will take loong time to create blend shapes from scratch!

0 Likes
Message 11 of 13

mcw0
Advisor
Advisor

How's it going?  Did everything workout?

0 Likes
Message 12 of 13

rehab_salem83
Enthusiast
Enthusiast

 still working on writing the script , it's a bit complicated 

0 Likes
Message 13 of 13

rehab_salem83
Enthusiast
Enthusiast

it works perfectly thank you so much for your help i really appreciate it😊

0 Likes