How to retrieve the blendshape targets with the shape editor worlkflow (C++API)

How to retrieve the blendshape targets with the shape editor worlkflow (C++API)

Anonymous
Not applicable
5,017 Views
22 Replies
Message 1 of 23

How to retrieve the blendshape targets with the shape editor worlkflow (C++API)

Anonymous
Not applicable

Hello,

 

We have a Maya mesh exporter to a proprietary format. This format is handling blendshape targets, and was correctly exported up to maya2016. With the Shape Editor workflow thou, it seems that the API is unable to return the different targets as it used to do :

 

- If I ask the MFnBlendshapeDeformer for getBaseObejcts(), it does return the correct objet as before.

- when I ask for getTargets(...), the same way it worked previously, it either returns "invalidParameter", if we did not play with the shapeEditor at all, or it returns correctly then goes to targetItemIndexList(...) which returns an invalid number of indices compared to the target objects.

 

Does anyone have a sample/ code snippet of plugin export, which would be compatible with the shape editor worlkflow ? Or any additional help would be welcome !

 

Thank you

 

0 Likes
Accepted solutions (1)
5,018 Views
22 Replies
Replies (22)
Message 21 of 23

cheng_xi_li
Autodesk Support
Autodesk Support
Accepted solution

Hi,

 

I've discussed with our engineers and did some research recently. The MFnBlendShapeDeformer::getTargets will only return targets which have connections. Like

blendShape1.inputTarget[0].inputTargetGroup[0].inputTargetItem[6000].inputGeomTarget

If the target is modified baseObject, the data will be stored inside inputPointsTarget and inputComponentsTarget attributes respectively. Like

blendShape1.inputTarget[0].inputTargetGroup[0].inputTargetItem[6000].inputPointsTarget 
blendShape1.inputTarget[0].inputTargetGroup[0].inputTargetItem[6000].inputComponentsTarget

There isn't an easy workaround available at the moment, you may need to check the blendshape node's attributes manually to get correct results. Here is the node's attributes reference.

 

Yours,

Li

0 Likes
Message 22 of 23

golaem
Enthusiast
Enthusiast

Thank you for this answer, that should allow us to go further and handle most of blendshapes by requesting those attributes

 

There is still a question before I am good to go :

 

How can the matching be done between the mesh using the blendshape and the blendshape inputTarget index, as the blendshape inputGeometry is not always linked when using blendshape editor ?

 

Also, it would be nice to put a word on the API side of MFnBlendshapeDeformer about that second workflow, and refer to the blendshape node attributes page if there is no API accessor.

 

Even better would be to fix the API accessors to use those attributes "automagically" 

 

Best Regards

0 Likes
Message 23 of 23

Anonymous
Not applicable

I have accepted cheng.xi.li suggestion as the solution, given that it should solve our issue for handling the blendshapes with deleted targets. However an API access would be nice performance-wise and for clarity of API.

 

Thank you

0 Likes