instances issue

Issue #57 resolved
Alessandro Padovani created an issue

tested with daz studio 4.12.086, blender 2.82a, plugin commit dd85b63

I don’t know if this is related to #54 to some extent.

It seems instances don’t work fine anymore. I didn’t use/test them in a long time so I can’t tell when we lost track. Below an example first daz then blender. We see that in blender the scale and position is wrong.

I’m using the instances-2.duf example that’s available in the old tracker, where there’s also an explanation of instances in blender 2.79 and daz studio for anyone interested. I see in blender 2.8 the plugin uses collection instances instead.

https://bitbucket.org/Diffeomorphic/import-daz-archive/issues/91/instancing

Comments (14)

  1. Thomas Larsson repo owner

    Issue #54 revealed problems with nested instance groups, which triggered a major rewrite of the instancing code. Unfortunately, I released this code before it was properly tested. Instancing is now back and should work at least as well as before, and in fact much better in more complex situations, such as the case in the attached file.

  2. Alessandro Padovani reporter

    I tested twice just to be sure. As for commit c273e86 the example above seems to work fine with the “unmorphed unique” and “unmorphed shared” import options. If I choose the “dbz json file” option then it doesn’t work and I get what reported in the above pictures with the red cubes all scrambled around.

    Scene file copied here for convenience.

  3. Alessandro Padovani reporter

    The same goes for the instances-3 example it works fine with the unmorphed options but has issues with the dbz.

  4. Thomas Larsson repo owner

    I never thought of exporting a dbz file in this case. Instancing is typically used in enviroments where you normally don’t need to apply morphs. But I guess it could be used also with characters, e.g. for buttons in a shirt.

    Anyway, the issue should be resolved now, if you reexport the dbz file from from DS. The new export script zeroes the world-space transformations of all nodes before exporting them. An extra bonus is that the import code could be simplified, because there is no longer a need to distinguish between the different fitting modes.

  5. Alessandro Padovani reporter

    There’s not so much difference between environments and characters. That is, an environment may very well be rigged and have its own morphs as well. As for commit 6358404 when I saw that it clears world space transformations I was first worried that it wouldn’t work for hierarchies but I tested it and it seems to work great. I’m marking as resolved thank you Thomas for the fix.

    As a little side note. I believe the instances management with collections is very well designed and it mimics perfectly what we have in daz studio. I would suggest though to give more meaningful names to the references. That is, the top collection that contains the references for the instanced objects. Below an example. This is a very minor note of course.

  6. Alessandro Padovani reporter

    It seems commit 8c0dee8 introduced some bugs. The position of the first instanced objects is lost. Also I’m not sure if the top collection named “Collection” is on purpose, if it’s not needed for something then it can be avoided.

    Below an example with the instances-2.duf scene, first daz then blender, the dbz option is used.

  7. Thomas Larsson repo owner

    I reverted too much in order to make armatures correct. Now both armatures and instances work correctly.

    The collection issue was that the reference collection was create under the active collection rather than the scene collection. Fixed now.

  8. Alessandro Padovani reporter

    Commit e1659e7 seems to work great ! I tested the instances example with the unmorphed and dbz options and they both work fine. As reference to #61 also a posed and dressed character imports fine. So at least we have the same features level of the old instances in blender 2.79.

    Thank you Thomas for the great job. Marking as resolved.

    edit. note. See #755 for more instances features.

  9. Log in to comment