GS.useInheritScale = False not respected when I call import_daz programmatically

Issue #2441 resolved
Rakete created an issue

I only tried this in my fork, so potentially this is not actually an issue. But when I call import_daz like so:

GS.useInheritScale = False
bpy.ops.diffeo_sync.import_daz(
    directory=scene_dir,
    files=[{'name': duf_filename}],
    materialMethod=material_method,
)

then my figure still ends up with all bones set to “inherit scale: FULL”. When I import through the UI though it works correctly.

Comments (5)

  1. Rakete reporter

    Ok, so when I change this:

    self.inherits_scale = node.inherits_scale
    node.inherits_scale = True
    

    to this:

    self.inherits_scale = node.inherits_scale
    #node.inherits_scale = True
    

    in node.py Instance.__init__.

    And this:

    #node.inherits_scale = False
    

    to this:

    node.inherits_scale = False
    

    in bone.py BoneInstance.__init__.

    Then it works.

  2. Thomas Larsson repo owner

    Fixed in last commit.

    I now assume that nodes don’t inherit scale by default. In most cases the default doesn’t matter, because it is explicitly stated in the duf file.

    The global option only affects bones, not nodes in general. And it can only turn on inheritance. If a bone inherits scale in DS, it does so in Blender as well, independent of the global setting.

    The twist bones always inherit scale. In the duf file there are formulas for the scale channels, but instead of setting up drivers for this we turn on inheritance which leads to the same result, but much cheaper.

  3. Log in to comment