how do we get rid of the bone custom properties ?

Issue #1719 resolved
Alessandro Padovani created an issue

1.7.2.1777

It seems there’s no way to get rid of the bone custom properties. I tried anything but I hope to miss something. Unless there’s some reason not to delete them so we can’t do it.

steps:

  1. import G8F
  2. finalize meshes
  3. finalize armature
  4. remove all drivers with “delete properties“
  5. check the custom properties for bones, they’re still there

Comments (8)

  1. Alessandro Padovani reporter

    The purpose here is, once we import and finalize the figure, to have a rig we can use without the runtime. Personally I do my own simple rigs for this but can’t get rid of the custom properties that I don’t need anymore. Other users may like to do their own rigs.

    To this end, users who want to do their own rigs over the daz imported rig, need a way to “clean up“ the custom properties.

    p.s. An alternative is to import fbx or collada to do custom rigs, but unfortunately those formats don’t import a good rig and some bones need to be adjusted by hand especially leaf bones. So if we can use the rig from diffeomorphic it would be easier.

    p.p.s. If all the custom properties created by the addon have “Daz“ in the name, then we could delete all properties in the scene having “Daz“ in the name, but I have no idea how to script this.

  2. Alessandro Padovani reporter

    Changed from bug to proposal since I understand finalized figures are anyway intended for the runtime, so custom properties are needed.

  3. Thomas Larsson repo owner

    There are even more properties if you toggle to edit mode.

    These properties are necessary for loading poses. The purpose of the finalize tool is to get rid of custom properties that are used for setup, but to keep those that are needed for posing. One could of course consider removing the remaining bone properties too if the user is only going to do hand animation from scratch, but that would be a another tool.

    I did add a button called “Remove DAZ Properties” in the utilities panel last week, after the rewrite of the global settings dialog. The old dialog used scene properties to display the global settings, but those are just junk now.

  4. Alessandro Padovani reporter

    Unless I miss something, it is both cumbersome and not necessary to keep all the daz bones properties stored in the blender figure. I agree we need some daz properties to load a pose, specifically the axes map, but the pose will be always relative to the daz base figure, for example G8F if it is a G8F pose.

    We could store the daz bones properties for G1-G9 in a json file in the data folder, that already the addon does for other data. Then the pose loader refers to the json for pose conversion. There’s no need to store the daz bones properties in each and every blender figure in the scene.

    Then for a custom figure, I mean not G1-G9 but a PA custom figure as a creature or alien, yes we need to map the daz properties on the figure because there’s no standard figure to refer to. Or create a new json for the custom figure the first time we load the custom figure. But for custom figures it is also unlikely to have lots of pose collections.

    Let me know what you think.

    p.s. Are there other custom properties stored in the figure apart daz bones ?

  5. Thomas Larsson repo owner

    DazHead is the head location in the baked rig, so that differs between different characters of the same type. I don’t think poses will be imported correctly if the pivot point is incorrect, so that must be kept.

    DazTail doesn’t seem to be used at all, so it can be removed completely. It is a remnant of the old way of making bones, where the bone tail was the DS end_point rather than being given by the center_point and orientation.

    The other properties are the same for rigs of the same type, so they could be stored in a json file.

  6. Alessandro Padovani reporter

    But the daz head is already baked in the blender bone, that’s the pivot. I mean we use the daz properties when we create the armature in blender. The head doesn’t change unless the user edits the armature, and even so the pose will be relative to the blender head anyway, not the daz head. I don’t see how the edit properties can be useful to load a pose, we should need only the axes map for conversion, in the pose properties, that’s always the same for every figure in the same generation. Same for ERCs.

    Let me know what you think.

    p.s. workaround. For my own purpose I resolved by commenting out the lines in bone.py where the custom properties are added. This way loading poses doesn’t work but I get a clean armature for my custom rigs. Other users interested in making custom rigs out of the daz rig can do the same. Then to load daz poses and animations to my custom rigs I can always use a constraints setup from a daz rig as in #1709.

  7. Thomas Larsson repo owner

    Removing the custom properties is too complex. They are used in non-trivial ways and I cannot predict if doing it differently will introduce new bugs. However, I wrote a utility script that removes all custom properties defined by the daz importer (or more precisely, all properties that start with “Daz”). After removing the properties, poses can no longer by loaded. Existing animations including morphs should still work, although the UI is gone. If you want to change a morph you have to find the slider among the object properties.

    The script can be found here:

    https://bitbucket.org/Diffeomorphic/daz-importer-scripts/src/master/utilities/remove_daz_props.py

  8. Alessandro Padovani reporter

    The script works great, and it is also easy to understand and customize, thank you for this utility.

  9. Log in to comment