Thank u @i_mazlov
I appreciate you pointing me in the right direction. I will try to understand the workings behind the posemorph tag!
Latest posts made by kangddan
-
RE: Adding a Morph Deformer Causes Pose Morph Tag to Stop Working
-
RE: Adding a Morph Deformer Causes Pose Morph Tag to Stop Working
Hello everyone, I seem to have found a solution. You just need to go to the Falloff option in Morph and add a default parameter
data = c4d.FieldList() morph[c4d.FIELDS] = data
This way, the PoseMorph tag becomes effective. I still don't understand why this is necessary, as I can't find any python related content about the Morph deformer:(
-
Adding a Morph Deformer Causes Pose Morph Tag to Stop Working
Hello all, I've noticed that my Pose Morph tag stops working after I add a Morph Deformer. It seems that I can't replicate the manual process of adding the Morph Deformer. What might I be doing wrong?
The main function of the code is to copy the selected object, then add a pose morph, and set the target to the selected object. The reason for adding the Morph Deformer is that I can offset issues with priority lag. However, in the code, once I add the Morph Deformer, the Pose Morph stops workingimport c4d def copyObj(obj): _copyObj = obj.GetClone(); doc.AddUndo(c4d.UNDOTYPE_NEW, _copyObj) _copyObj.SetName('{}_copy'.format(obj.GetName())) _copyObj[c4d.ID_BASEOBJECT_VISIBILITY_EDITOR] = 2 _copyObj[c4d.ID_BASEOBJECT_VISIBILITY_RENDER] = 2 doc.InsertObject(_copyObj); _copyObj.InsertAfter(obj) for tag in _copyObj.GetTags(): if isinstance(tag, c4d.modules.character.CAWeightTag): tag.Remove() for child in _copyObj.GetChildren(): if child.CheckType(c4d.Oskin): child.Remove() return _copyObj def addPoseMorph(target, obj): pmTag = obj.MakeTag(1024237) priorityData = c4d.PriorityData() priorityData.SetPriorityValue(c4d.PRIORITYVALUE_MODE, c4d.CYCLE_INITIAL) pmTag[c4d.ID_CA_POSE_BASE_PRI] = priorityData pmTag[c4d.ID_CA_POSE_POINTS] = 1 baseMorph = pmTag.AddMorph() # id0 targetMorph = pmTag.AddMorph() # id1 pmTag.UpdateMorphs() targetMorph.SetName('target') pmTag.SetActiveMorphIndex(1) pmTag[c4d.ID_CA_POSE_TARGET] = target pmTag[c4d.ID_CA_POSE_MODE] = 1 return pmTag def addMorphDeformer(obj, tag): morph = c4d.BaseObject(1019768) morph.InsertUnder(obj) morph[c4d.ID_CA_MORPH_DEFORMER_OBJECT_TAG] = tag morph[c4d.ID_CA_MORPH_DEFORMER_OBJECT_APPLY_BASEPOSE] = True def create(): sel = doc.GetSelection() if not sel: return doc.StartUndo() for o in sel: doc.AddUndo(c4d.UNDOTYPE_CHANGE, o) o[c4d.ID_BASEOBJECT_VISIBILITY_EDITOR] = 1 o[c4d.ID_BASEOBJECT_VISIBILITY_RENDER] = 1 cObj = copyObj(o) pmTag = addPoseMorph(o, cObj) addMorphDeformer(cObj, pmTag) doc.EndUndo() c4d.EventAdd() if __name__ == '__main__': create()
-
How to hide object local coordinates
As shown in the picture, I have hidden the selected objects in the outliner, but when I middle-click on the Null object, I can still see the local coordinate axes in the viewport and the number of selected objects in the attribute panel. Is there any way to completely hide these objects?
import c4d doc = c4d.documents.GetActiveDocument() def hide_obj(): doc.StartUndo() sel=doc.GetSelection() for obj in sel: doc.AddUndo(c4d.UNDOTYPE_CHANGE, obj) obj.ChangeNBit(c4d.NBIT_OHIDE, c4d.NBITCONTROL_SET) doc.EndUndo() c4d.EventAdd() if __name__ == '__main__': hide_obj()
-
RE: TimeLine Window Custom open
Cool idea:), it's similar to Animbot in MAYA with custom widgets on the timeline, though I don't know how to do it, but I'm looking forward to you being able to implement it!