Import errors
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)
-
repo owner -
reporter Yes, now error is not thrown, but the result is same as before object location is incorrect
What I tried import was asset https://www.daz3d.com/shipping-yard-construction-set whole collection.
Tested Easy and normal import (in both cases option was “Unmorphed Unique”) - same issue (incorrect object location).
-
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
-
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.
-
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.
-
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.
-
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.
-
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.
-
repo owner - attached instances-5.duf
-
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.
-
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.
-
- attached instances-5-fix.duf
same as instances-5 but without cross references
-
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.
-
Personally agreed. Though ideally the solution would be to get blender with the same “bug” as daz studio, that is, ignoring cross references.
-
repo owner That would be ideal, but I don’t want to spend more time on this. Not right now, anyway.
-
repo owner - changed status to closed
- Log in to comment
Should work now. I hadn’t tried easy import with files that contain instances before.