When import environments with instance objects, instances are not being preserved

Issue #755 resolved
Aaron J. Olson created an issue

I have noticed, in a few cases, when importing certain environment models, many of the instances objects in scene are not being preserved. I am not sure if this is a known issue, or something I am just doing wrong, but if it could be explained, resolved, fixed, or handled for that would be awesome!
Here is an example model that demonstrates the issue

Notice the red arrows pointing to the instance objects, little rope things, straw, poles.

When I import it into blender, it would be really nice if it could preserve those instances so that it looked the same way on the other side.
They are denoted like this in the scene outliner

I perform the usual save scene, then run the diffeo export to blender script.
When I import into blender however, it comes through like this

where most of the poles, ropes and straw are gone.

I am assuming what is left is the original objects, but none of the instances.
Here are my plugin settings

For import ^^

Global ^^

Any ideas what the issue might be or anything I can do to work around it?
Thank you!

Comments (26)

  1. Alessandro Padovani

    @Aaron I tested a complex example with hierarchies and groups and instances seem to work fine here, even in this complex case. Test scene included instances.duf. See if my test scene works fine for you.

    What asset do you use ? I’d like to understand what’s the limit when importing instances and why.

  2. Alessandro Padovani

    @Thomas, I did another scene with a hierarchy of group instances and there seem to be a bug in this case. Though a “small one” in that an extra instance is generated. So the “limit” seems to be a hierarchy of group instances.

    Test scene instances-2.duf. Hope this may help.

  3. Thomas Larsson repo owner

    Hm. I thought I made some progress, in particular the attached file comes in right, and my shipyard is much better. But now I realize that Alessandro’s file doesn’t work at all.

    The problem is that in DS a node instance can be a child of the object that it instances, but that would lead to a dependency cycle in Blender.

  4. Alessandro Padovani

    edit. Thomas, it doesn’t seem that the issue is cross references. Not my examples nor the watch tower get cross references as far as I see. May be I got what it is but need some more tests. Will update later.

  5. Thomas Larsson repo owner

    The last commit works much better. All my simple test files are imported correctly, and of my two complex examples, the red crow inn and the shipyard, there are only problems with a few containers in the latter.

    That a node instance can be a child of its own target is really weird, and it is not clear to me how that should be translated into Blender. And it does occur in reality, the above example was extracted from the shipyard.

    I currently use the heuristics that if the target contains an empty, and there is a reference to the target down the line, the empty and its children are not added to the target collection. So in the example above, Cone and Sphere are added to the Cone REF collection, but Group (2) and Cone Instance (2) are not, even though they are children of Cone.

  6. Alessandro Padovani

    I can confirm that commit e7edac2 is better. Both my examples work fine now. It doesn’t seem to solve the issue with the watch tower. I’ll update on it later.

  7. Alessandro Padovani

    Ok I believe I got it.

    The issue is that daz studio supports a type that we didn’t know about and personally I have no idea how this is generated, may be via script because I can’t do it with the user interface.

    Below an example, it’s the ladder extracted from the watch tower. Test scene included ladder.duf. We see that the stairs are made with instances, but only one “GroupInstance“ is listed in the daz scene pane.

    If we look at the duf file we get a type “group_instance“ that lists the instances of the stair. Again please note that those instances do not appear in the daz scene pane.

    On the contrary the ladder side gets a normal instance with type “instance“ that’s listed in daz scene pane and correctly imported.

  8. Thomas Larsson repo owner

    I don’t have access to the orc village, so I cannot test. Specifically I’m missing the files MDOV_Watch_Tower_Stair.dsf and MDOV_Watch_Tower_Ladder_Side.dsf. And some uv files, but they are not essential.

  9. Alessandro Padovani

    Thomas, unfortunately I have no way to provide a test scene with primitives, because the daz user interface doesn’t allow to create a “group_instance“ type. I suspect this is created by some external script or addon. If you can try to fix it by looking at the duf to understand the structure, then I can test if it works fine.

    In the ladder scene I removed the textures so the uv maps do nothing.

  10. Alessandro Padovani

    On second thought, given that the missing files are simple “cylinders“, with no real “artistic value”, I feel I can upload them for test purposes only that should be a “fair use“ enough.

  11. Thomas Larsson repo owner

    The test file works now. Strangely enough only in Blender, in DS I only see a single stair and ladder side.

  12. Alessandro Padovani

    Commit 8456d62 works great here. It loads fine all the examples and the full watch tower too. As for the ladder not working in daz studio it is probably due to some missing files, as the uv sets.

    If Aaron has nothing to add we may mark as resolved. Then I’ll delete the dsf files.

  13. Aaron J. Olson reporter

    Nice! Thank you so much! I just pulled down the latest version and the watch tower is working for me too!

  14. Log in to comment