Import errors

Issue #479 closed
Noname created an issue

Hello,

Error when importing assets (easy import):

Python: Traceback (most recent call last):
  File "C:\Users\user\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\Diffeomorphic-import_daz-2f68c0ee3810\error.py", line 247, in execute
    self.run(context)
  File "C:\Users\user\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\Diffeomorphic-import_daz-2f68c0ee3810\main.py", line 425, in run
    self.treatRig(context, rigname)
  File "C:\Users\user\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\Diffeomorphic-import_daz-2f68c0ee3810\main.py", line 501, in treatRig
    activateObject(context, mainMesh)
  File "C:\Users\user\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\Diffeomorphic-import_daz-2f68c0ee3810\utils.py", line 108, in activateObject
    context.view_layer.objects.active = ob
RuntimeError: Error: ViewLayer 'View Layer' does not contain object 'SYCC Building REF'


location: <unknown location>:-1

Thanks in advance.

Comments (16)

  1. Thomas Larsson repo owner

    Should work now. I hadn’t tried easy import with files that contain instances before.

  2. Noname reporter

    Encountered another issue on two different assets while importing using EasyImport:

    Python: Traceback (most recent call last):
      File "C:\Users\user\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\Diffeomorphic-import_daz-58550aa1971c\error.py", line 247, in execute
        self.run(context)
      File "C:\Users\user\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\Diffeomorphic-import_daz-58550aa1971c\main.py", line 431, in run
        self.treatRig(context, rigname)
      File "C:\Users\user\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\Diffeomorphic-import_daz-58550aa1971c\main.py", line 507, in treatRig
        ob.select_set(True)
    RuntimeError: Error: Object 'grBox01 REF' can't be selected because it is not in View Layer 'View Layer'!
    
    
    location: <unknown location>:-1
    

  3. Thomas Larsson repo owner

    The error should be gone now. Both problems arise becaues the plugin imports some hidden objects that do not belong to the active view layer. The fix consists of ignoring all such hidden objects.

  4. Noname reporter

    While trying https://www.daz3d.com/shipping-yard-construction-set error is gone, but imported objects position is still incorrect.

    Other asset imports correctly.

    @Thomas Dunno if You want to work on it or not, I seen also other assets that do import correctly but position of object is incorrect, for Me personally not big deal but from plugin stand point this is an issue, if not then this task can be closed.

  5. Thomas Larsson repo owner

    The problem seems to arise when the scene contains a hierarchy of instances. Groups contain several instances of some objects, and the scene contains several instances of the groups. This will take some time to sort out.

  6. Thomas Larsson repo owner

    This was harder than I thought. No progress so far, but at least the code has been cleaned up. I will return to this issue eventually, but perhaps not in the near future.

  7. Thomas Larsson repo owner

    This turned out to be real hard. The problem has to do with recursive instances. It has not been solved in general, and if it occurs the importer issues a warning and lists the problematic assets. Scenes without recursive instances should work correctly. A simple test file showing the problem is attached.

  8. Alessandro Padovani

    commit 57a7b80

    As a personal note, in my opinion the instances-5.duf example doesn’t work in daz studio too, though in blender we get a different result. I mean, with “group instance“ I’d expect two cubes, not one. So it seems daz studio deals with the recursion by ignoring cross references.

    I don’t know if this may help.

  9. Alessandro Padovani

    As a proof of concept, the scene instances-5-fix.duf loads fine both in daz studio and in blender. And it’s what’s expected and how instances should be used in the instances-5.duf example to get a single cube in daz studio. Instead of ignoring cross references.

    What I mean at the end is that cross references confuse both blender and daz studio, though in different ways. And if a PA is using cross references then he’s not fully aware of the meaning of instances and how they should be used. He just uses a daz studio “bug“, or “incorrect behaviour“, to get the scene done without caring to understand what he’s doing.

  10. Thomas Larsson repo owner

    The importer issues a warning for the fixed file too, since Cube Instance is a descendant of Cube. But in this case the results in DS and Blender are the same. So the addon may warn too often, but better that than too seldom.

    The shipyard is the only place where I have encountered this problem, so I think that it is enough if it loads without dependency cycles and the user is notified that the result may be incorrect. Anyway, I will leave the code as it is, since I’m really tired of dealing with dubious instancing.

  11. Alessandro Padovani

    Personally agreed. Though ideally the solution would be to get blender with the same “bug” as daz studio, that is, ignoring cross references.

  12. Thomas Larsson repo owner

    That would be ideal, but I don’t want to spend more time on this. Not right now, anyway.

  13. Log in to comment