custom blendshape

53 views
Skip to first unread message

Rémi Deletrain

unread,
Sep 25, 2015, 7:01:31 AM9/25/15
to Python Programming for Autodesk Maya
Hello everyone,

I am trying to change the deform blendshape. I will be starting from zero with the example of Chad Vernon to a single input.


Everything works as I want. The calculation is made good and distort what I want. I still have a few added options to achieve what I want but the bottom focntionne.

But I am now looking to do the same with an input multi entry. And I block ...
The node works but applies only in terms of my first mesh.

for this I added a compound attribute.

-------------------
MFnCompoundAttribute targetGeoCompoundAttr;
aTargetGeoCompound = targetGeoCompoundAttr.create ("inputTargetGroup", "itg", & status);
CHECK_MSTATUS_AND_RETURN_IT (status);
CHECK_MSTATUS (targetGeoCompoundAttr.setReadable (true));
CHECK_MSTATUS (targetGeoCompoundAttr.setWritable (true));
CHECK_MSTATUS (targetGeoCompoundAttr.setKeyable (true));
CHECK_MSTATUS (targetGeoCompoundAttr.setStorable (true));
CHECK_MSTATUS (targetGeoCompoundAttr.setConnectable (true));
targetGeoCompoundAttr.setArray (true);
targetGeoCompoundAttr.setIndexMatters (true);
-------------------

and the deform I read like this

-------------------
MArrayDataHandle targetArray = data.inputArrayValue (aTargetGeoCompound);
targetArrayCount targetArray.elementCount int = ();

for (int idx = 0; idx <targetArrayCount; idx ++) {

targetArray.jumpToElement (idx);
MDataHandle targetElement targetArray.inputValue = ();

// Get Weight
targetWeight targetElement.child = float (atargetWeight) .asFloat ();
* = approx targetWeight;
....

for (;! itGeo.isDone (); itGeo.next ()) {

......

}
-------------------

I can not comprence is why it does not work ...

someone an idea?

Rémi Deletrain

unread,
Sep 25, 2015, 8:19:40 AM9/25/15
to Python Programming for Autodesk Maya

Rémi Deletrain

unread,
Sep 25, 2015, 4:14:07 PM9/25/15
to Python Programming for Autodesk Maya
It's me again!

I changed the method to arrive what I wanted.
I have updated the files on the link below.


I can finish my tool by adding my duties.

Thank you to those who have read and tried to solve my problem.
Reply all
Reply to author
Forward
0 new messages