weight maps

Is there a way to get hold of the weightmap information attached to a vertice / mesh or bone?

I can get the node, the vertex, the Skeleton and the bone. I hear that boneBinding links the two together, but how do you get that information? 

Comments

  • I would also like to know more
  • I suspect, looking at the DS3 scripting, that you need to get the joint modifier, in DS you'd get the DzPoserJointParam from there and then the weight maps from the joint param. However, that's all Poser-style rigging (Legacy rigging) so I'm not sure how it woudl need adapting, and the modifiers don't yey seem to haev documentation so you'd have to go into discovery mode (iterate over the object's members) and see what you coudl figure out.

  • Thanks for the quick response!
  • There are quite a lot of SDK/scripting chnaegs in the Change Log ( http://docs.daz3d.com/doku.php/public/software/dazstudio/4/change_log#private_channel ) so bear in mind that this area may be subject to change

  • MikeDMikeD Posts: 252

    I have found out, searching a little bit in the weekend, some objects for the weight map manipulation (DS 4.10.0.123).

    I managed to make FaceGroups and to set new Bones for 750 nodes in a few mins with a script (ok I needed 2 days searching and writing the script but it was better than re-arrange manually 750 nodes in the Figure Setup pane). Using the next objects I managed to add "General Map" to all the new bones at once!

    I know that there is no documentation yet so the next list is retrieved throught the Scripting IDE console. I am not sure about the inheritance of each object as I hadn' t the time to check it.

     -- [DzWeightMapHandler] [ It seems to inherit "DzBase" (not sure for any other parent object):

         === An easy way to retrieve it is throught DzSkeleton.getSkinBinding() method
        "objectName",
        "name",
        "destroyed(QObject*)",
        "destroyed()",
        "deleteLater()",
        "nameChanged(QString)",
        "className()",
        "makePersistent()",
        "inherits(QString)",
        "iskindof(QString)",
        "getName()",
        "numWeightGroupsChanged()",
        "currentWeightGroupChanged()",
        "currentWeightContextChanged()",
        "numWeightMapsChanged()",
        "possibleWeightMapsChanged()",
        "currentWeightContext()",
        "canEditWeights()",
        "getNumWeightGroups()",
        "getWeightGroup(int)",
        "setCurrentWeightGroup(DzWeightGroup*)",
        "currentWeightGroup()",
        "buildViewContextMenu(QMenu*)",
        "buildMenuPreWeightMapBrush(Dz3DViewport*,DzMenu*,QPoint)",
        "buildMenuPostWeightMapBrush(Dz3DViewport*,DzMenu*,QPoint)",
        "getNode()",
        "getFigure()",
        "getSkinBinding()",
        "setCurrentContext(DzNodeWeightHandler::BindingMapType)",
        "setSymmetricWeightAxis(int)",
        "getSymmetricWeightMap(DzWeightMap*)",
        "getSymmetricWeightAxis()",
        "setFigureContextForType(DzNodeWeightHandler::BindingMapType)"
    ]

  • MikeDMikeD Posts: 252
    edited February 2019

    [DzSkinBinding()] [ It seems to inherit "DzElement" or DzProperty (not sure):

    === An easy way to retrieve it is throught DzWeightMapHandler.getSkinBinding() method
        "objectName",
        "name",
        "elementID",
        "assetUri",
        "assetSource",
        "assetId",
        "assetAuthor",
        "assetFileRevision",
        "assetModifiedDate",
        "destroyed(QObject*)",
        "destroyed()",
        "deleteLater()",
        "nameChanged(QString)",
        "className()",
        "makePersistent()",
        "inherits(QString)",
        "iskindof(QString)",
        "getName()",
        "propertyAdded(DzProperty*)",
        "propertyRemoved(DzProperty*)",
        "propertyListChanged()",
        "propertyListInTreeChanged()",
        "propertyTreeChanged()",
        "privatePropertyAdded(DzProperty*)",
        "privatePropertyRemoved(DzProperty*)",
        "privatePropertyListChanged()",
        "privatePropertyListInTreeChanged()",
        "privatePropertyTreeChanged()",
        "labelChanged(QString)",
        "parentChanged()",
        "mergeElementSignal(const DzElement*,DzElementDuplicateContext*)",
        "duplicateElementSignal(DzElement*,DzElementDuplicateContext*)",
        "createElementCopySignal(DzElementDuplicateContext*)",
        "setAttributes(const DzSettings*)",
        "setName(QString)",
        "setLabel(QString)",
        "update()",
        "clearAnimData(DzTimeRange)",
        "clearAllAnimData()",
        "addProperty(DzProperty*)",
        "insertProperty(int,DzProperty*)",
        "removeProperty(DzProperty*)",
        "removeProperty(QString)",
        "moveProperty(DzProperty*,DzElement*)",
        "addPrivateProperty(DzProperty*)",
        "insertPrivateProperty(int,DzProperty*)",
        "removePrivateProperty(DzProperty*)",
        "removePrivateProperty(QString)",
        "movePrivateProperty(DzProperty*,DzElement*)",
        "addDataItem(DzElementData*)",
        "removeDataItem(DzElementData*)",
        "deleteDataItem(DzElementData*)",
        "copyFrom(const DzElement*)",
        "setLoadScript(DzScript*)",
        "beginEdit()",
        "finishEdit()",
        "cancelEdit()",
        "shouldSortOnLoad()",
        "getLabel()",
        "getAttributes(DzSettings*)",
        "getNumProperties()",
        "getProperty(int)",
        "getPropertyList()",
        "isPropertyNameUnique(QString&,bool)",
        "isPropertyNameUnique(QString&)",
        "getUniquePropertyName(QString)",
        "findProperty(QString)",
        "findProperty(QString,bool)",
        "findPropertyByLabel(QString)",
        "findPropertyByLabel(QString,bool)",
        "getPropertyGroups()",
        "findMatchingProperty(DzProperty*)",
        "getNumPrivateProperties()",
        "getPrivateProperty(int)",
        "getPrivatePropertyList()",
        "isPrivatePropertyNameUnique(QString&,bool)",
        "isPrivatePropertyNameUnique(QString&)",
        "getUniquePrivatePropertyName(QString)",
        "findPrivateProperty(QString)",
        "findPrivateProperty(QString,bool)",
        "findPrivatePropertyByLabel(QString)",
        "findPrivatePropertyByLabel(QString,bool)",
        "getPrivatePropertyGroups()",
        "getNumDataItems()",
        "getDataItem(int)",
        "getDataItemList()",
        "isDataItemNameUnique(QString&,bool)",
        "isDataItemNameUnique(QString&)",
        "getUniqueDataItemName(QString)",
        "findDataItem(QString)",
        "getLoadScript()",
        "copyToClipboard(QStringList)",
        "copyToClipboard()",
        "getNumElementChildren()",
        "getElementChild(int)",
        "getElementParent()",
        "inEdit()",
        "moveDataItemToIndex(DzElementData*,int)",
        "findDataItemIndex(DzElementData*)",
        "duplicateMissingCustomData(DzElement*)",
        "duplicateMissingProperties(DzElement*)",
        "duplicateMissingPrivateProperties(DzElement*)",
        "duplicateMissingCustomDataWithContext(DzElement*,DzElementDuplicateContext*)",
        "duplicateMissingPropertiesWithContext(DzElement*,DzElementDuplicateContext*)",
        "duplicateMissingPrivatePropertiesWithContext(DzElement*,DzElementDuplicateContext*)",
        "doMergeElement(const DzElement*,DzElementDuplicateContext*)",
        "doDuplicateElement(DzElementDuplicateContext*)",
        "mergeElement(const DzElement*,DzElementDuplicateContext*)",
        "duplicateElement(DzElement*,DzElementDuplicateContext*)",
        "createElementCopy(DzElementDuplicateContext*)",
        "currentValueChanged()",
        "aboutToBeRemoved()",
        -----------------------
        "removed()",
        "added()",
        "remapForTopologyChange(DzShape*,const DzIndexChangeSet*)",
        "remapForTopologyChangeSlot(DzShape*,const DzIndexChangeSet*)",
        "boneBindingAdded(DzBoneBinding*)",
        "boneBindingRemoved(DzBoneBinding*)",
        "boneBindingListChanged()",
        "weightsChanged()",
        "weightListChanged()",
        "blendWeightMapChanged()",
        "assetModified()",
        "assetWasSaved()",
        "normalized()",
        "bindModeChanged()",
        "generalModeChanged()",
        "scaleModeChanged()",
        "generalAutoNormalizeChanged()",
        "scaleAutoNormalizeChanged()",
        "localAutoNormalizeChanged()",
        "addBoneBinding(DzBoneBinding*)",
        "removeBoneBinding(int)",
        "removeBoneBinding(DzBoneBinding*)",
        "removeAllBindings()",
        "checkAndNormalize(PriorityType,NormalizeType,bool)",
        "checkAndNormalize(PriorityType,NormalizeType)",
        "checkAndNormalize(PriorityType)",
        "checkAndNormalize()",
        "normalize(PriorityType,NormalizeType,bool)",
        "normalize(PriorityType,NormalizeType)",
        "normalize(PriorityType)",
        "normalize()",
        "normalize(DzNode*,NormalizeType,bool)",
        "normalize(DzNode*,NormalizeType)",
        "normalize(DzNode*)",
        "normalize(DzBoneBinding*,NormalizeType,bool)",
        "normalize(DzBoneBinding*,NormalizeType)",
        "normalize(DzBoneBinding*)",
        "normalize(DzBoneBinding*,DzBoneBinding*,NormalizeType,bool)",
        "normalize(DzBoneBinding*,DzBoneBinding*,NormalizeType)",
        "normalize(DzBoneBinding*,DzBoneBinding*)",
        "convertToGeneralMaps(DzBoneBinding::LocalAveragingOption)",
        "convertToGeneralMaps()",
        "convertFromGeneralToLocal()",
        "buildBlendWeightMapFromLocal()",
        "buildGeneralWeightMaps(DzWeightMapList&,DzBoneBindingList&,DzBoneBinding::LocalAveragingOption)",
        "buildGeneralWeightMaps(DzWeightMapList&,DzBoneBindingList&)",
        "getBindingMode()",
        "setBindingMode(int)",
        "getGeneralMapMode()",
        "setGeneralMapMode(int)",
        "getScaleMode()",
        "setScaleMode(int)",
        "setBlendMap(DzWeightMap*)",
        "getBlendMap()",
        "reduceWeightMemory()",
        "getNumBoneBindings()",
        "getBoneBinding(int)",
        "findBoneBinding(DzNode*)",
        "findBoneBinding(QString)",
        "invalidate()",
        "invalidateAccumulation()",
        "invalidateBlend()",
        "findSkin(const DzSkeleton*,int*)",
        "findSkin(const DzSkeleton*)",
        "findSkinFromNode(DzNode*)",
        "findSkinFromObject(int,DzObject*,int*)",
        "findSkinFromObject(int,DzObject*)",
        "isSingleSkinFigure(DzNode*)",
        "modifyAsset()",
        "modifyAsset(DzUri)",
        "hasGeneralMaps()",
        "hasScaleMaps()",
        "hasLocalMaps()",
        "clearLocalWeights()",
        "clearScaleWeights()",
        "clearGeneralWeights()",
        "invalidateBlendWeights()",
        "setAutoNormalizeGeneralMaps(bool)",
        "setAutoNormalizeScaleMaps(bool)",
        "setAutoNormalizeLocalMaps(bool)",
        "getAutoNormalizeGeneralMaps()",
        "getAutoNormalizeScaleMaps()",
        "getAutoNormalizeLocalMaps()",
        "setTargetVertexCount(int)",
        "getTargetVertexCount()",
        "buildManipulationMaps()",
        "Linear",
        "DualQuat",
        "General",
        "Local",
        "Blended",
        "ScaleMaps",
        "BindingMaps",
        "RootLowest",
        "RootHighest",
        "NormalizeNone",
        "NormalizeX",
        "NormalizeY",
        "NormalizeZ",
        "NormalizeGeneral",
        "NormalizeScale",
        "NormalizeWeight",
        "NormalizeAll"
    ]

     

    Post edited by MikeD on
  • MikeDMikeD Posts: 252

    [DzBoneBinding()] [ It seems to inherit "DzElement" (not sure):


        "objectName",
        "name",
        "elementID",
        "destroyed(QObject*)",
        "destroyed()",
        "deleteLater()",
        "nameChanged(QString)",
        "className()",
        "makePersistent()",
        "inherits(QString)",
        "iskindof(QString)",
        "getName()",
        "propertyAdded(DzProperty*)",
        "propertyRemoved(DzProperty*)",
        "propertyListChanged()",
        "propertyListInTreeChanged()",
        "propertyTreeChanged()",
        "privatePropertyAdded(DzProperty*)",
        "privatePropertyRemoved(DzProperty*)",
        "privatePropertyListChanged()",
        "privatePropertyListInTreeChanged()",
        "privatePropertyTreeChanged()",
        "labelChanged(QString)",
        "parentChanged()",
        "mergeElementSignal(const DzElement*,DzElementDuplicateContext*)",
        "duplicateElementSignal(DzElement*,DzElementDuplicateContext*)",
        "createElementCopySignal(DzElementDuplicateContext*)",
        "setAttributes(const DzSettings*)",
        "setName(QString)",
        "setLabel(QString)",
        "update()",
        "clearAnimData(DzTimeRange)",
        "clearAllAnimData()",
        "addProperty(DzProperty*)",
        "insertProperty(int,DzProperty*)",
        "removeProperty(DzProperty*)",
        "removeProperty(QString)",
        "moveProperty(DzProperty*,DzElement*)",
        "addPrivateProperty(DzProperty*)",
        "insertPrivateProperty(int,DzProperty*)",
        "removePrivateProperty(DzProperty*)",
        "removePrivateProperty(QString)",
        "movePrivateProperty(DzProperty*,DzElement*)",
        "addDataItem(DzElementData*)",
        "removeDataItem(DzElementData*)",
        "deleteDataItem(DzElementData*)",
        "copyFrom(const DzElement*)",
        "setLoadScript(DzScript*)",
        "beginEdit()",
        "finishEdit()",
        "cancelEdit()",
        "shouldSortOnLoad()",
        "getLabel()",
        "getAttributes(DzSettings*)",
        "getNumProperties()",
        "getProperty(int)",
        "getPropertyList()",
        "isPropertyNameUnique(QString&,bool)",
        "isPropertyNameUnique(QString&)",
        "getUniquePropertyName(QString)",
        "findProperty(QString)",
        "findProperty(QString,bool)",
        "findPropertyByLabel(QString)",
        "findPropertyByLabel(QString,bool)",
        "getPropertyGroups()",
        "findMatchingProperty(DzProperty*)",
        "getNumPrivateProperties()",
        "getPrivateProperty(int)",
        "getPrivatePropertyList()",
        "isPrivatePropertyNameUnique(QString&,bool)",
        "isPrivatePropertyNameUnique(QString&)",
        "getUniquePrivatePropertyName(QString)",
        "findPrivateProperty(QString)",
        "findPrivateProperty(QString,bool)",
        "findPrivatePropertyByLabel(QString)",
        "findPrivatePropertyByLabel(QString,bool)",
        "getPrivatePropertyGroups()",
        "getNumDataItems()",
        "getDataItem(int)",
        "getDataItemList()",
        "isDataItemNameUnique(QString&,bool)",
        "isDataItemNameUnique(QString&)",
        "getUniqueDataItemName(QString)",
        "findDataItem(QString)",
        "getLoadScript()",
        "copyToClipboard(QStringList)",
        "copyToClipboard()",
        "getNumElementChildren()",
        "getElementChild(int)",
        "getElementParent()",
        "inEdit()",
        "moveDataItemToIndex(DzElementData*,int)",
        "findDataItemIndex(DzElementData*)",
        "duplicateMissingCustomData(DzElement*)",
        "duplicateMissingProperties(DzElement*)",
        "duplicateMissingPrivateProperties(DzElement*)",
        "duplicateMissingCustomDataWithContext(DzElement*,DzElementDuplicateContext*)",
        "duplicateMissingPropertiesWithContext(DzElement*,DzElementDuplicateContext*)",
        "duplicateMissingPrivatePropertiesWithContext(DzElement*,DzElementDuplicateContext*)",
        "doMergeElement(const DzElement*,DzElementDuplicateContext*)",
        "doDuplicateElement(DzElementDuplicateContext*)",
        "mergeElement(const DzElement*,DzElementDuplicateContext*)",
        "duplicateElement(DzElement*,DzElementDuplicateContext*)",
        "createElementCopy(DzElementDuplicateContext*)",
        ---------------------------------
        "boneChanged(DzNode*)",
        "weightsChanged()",
        "weightListChanged()",
        "bindingMatrixChanged()",
        "currentValueChanged()",
        "attributesChanged()",
        "aboutToDelete()",
        "boneParentChanged()",
        "setWeights(DzWeightMap*)",
        "setScaleWeights(DzWeightMap*)",
        "setLocalWeights(DzWeightMap*,int)",
        "setBulgeBinding(DzBulgeBinding*,int)",
        "setBone(DzBone*)",
        "setFigure(DzFigure*)",
        "setBindingMatrix(DzMatrix3)",
        "invalidateWeights()",
        "setLocked(bool)",
        "isLocked()",
        "hasLocalWeights()",
        "hasBulgeWeights()",
        "getBone()",
        "getBindingMatrix()",
        "getWeights()",
        "getScaleWeights()",
        "getLocalWeights(int)",
        "getBulgeBinding(int)",
        "getManipWeights()",
        "invalidateAccumulator()",
        "invalidateBlend()",
        "setFilterByBlend(bool)",
        "getFilterByBlend()",
        "getScaledOrigin()",
        "getLocalWeightCount()",
        "reduceWeightMemory()",
        "FIRST_AXIS",
        "SECOND_AXIS",
        "THIRD_AXIS",
        "SCALE_MAP",
        "USE_GENERAL_MAP",
        "DEFAULT_AVERAGE",
        "FALL_BACK_WHEN_MISSING",
        "FALL_BACK_DEFAULT_AVERAGE"
    ]

    to retrieve a bone weight map:

    //take the skeleton as oSkeleton//oSkeleton ....// get the weight map Handlervar oWeightMapHandler = oSkeleton.getWeightMapHandler();	      //take the skin bindingvar oSkinBinding= oWeightMapHandler.getSkinBinding();	    // take the Bone Binding for the bone "My_Bone"var oBoneBinding = oSkinBinding.findBoneBinding("My_Bone");//Take the weight map	    var oNewWeight = oBoneBinding.getWeights();

     

  • Do bear in mind that using undocumented methods may be a short-term solution for your own use the fact that they are not documented means they may well be changed or removed without any notice, causing your script to fail. Use them by all means, but do so with caution and an awareness that you may potentialy need to revisit your script following any update.

  • MikeDMikeD Posts: 252

    Do bear in mind that using undocumented methods may be a short-term solution for your own use the fact that they are not documented means they may well be changed or removed without any notice, causing your script to fail. Use them by all means, but do so with caution and an awareness that you may potentialy need to revisit your script following any update.

    Yes, thats very true Richard. In my case, the script just helped me took the rigged figure, but I wouldn't use the above methods for a commercial script!

    I should put that comment to my posts!!!

    yes

Sign In or Register to comment.