-
Notifications
You must be signed in to change notification settings - Fork 13
Fbx Camera Loader: No duplicated objects linked to scene collections #220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Fbx Camera Loader: No duplicated objects linked to scene collections #220
Conversation
LiborBatek
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All been working well and no issues were spotted. All good!
|
@BigRoy here you have it while in Loading_FBX_ABC_Camera.mp4 |
BigRoy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So after some more investigating, I'm pretty sure the issue is that we're essentially trying to link it where it's already linked (but were than after unlinking it too?)
@moonyuet thoughts?
@LiborBatek can you test if the change seems good to Kayla - and then see if it does actually solve the issue at hand.
| if obj.name in parent.objects: | ||
| self.log.info( | ||
| "Object with name '%s' already exists in the scene. " | ||
| "Skipping linking to the scene collection.", | ||
| obj.name, | ||
| ) | ||
| continue | ||
| parent.objects.link(obj) | ||
| collection.objects.unlink(obj) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I'm quite sure that I faced this same issue in another PR #214 which I tweaked here: 860200e
The issue of it already being linked - was that because by default it was already linked to parent because it is the active collection in some cases. And this active collection is where things are loaded into by default in blender so they were already linked, hence we can't link them again.
To avoid that ambiguous behavior I think we should just always unlink it from the active, and then link it to where we want it. Which means, just reversing the order of these here.
| if obj.name in parent.objects: | |
| self.log.info( | |
| "Object with name '%s' already exists in the scene. " | |
| "Skipping linking to the scene collection.", | |
| obj.name, | |
| ) | |
| continue | |
| parent.objects.link(obj) | |
| collection.objects.unlink(obj) | |
| collection.objects.unlink(obj) | |
| parent.objects.link(obj) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually - note that this fix ... is already pushed upstream ;) so you can just test develop @LiborBatek because it should be fixed already. :) If so, then we can just close this PR.
Changelog Description
This PR is to provide a quick fix to make sure no duplicated objects linked to scene collections.
Additional review information
As there is no duplicated object linked to scene collections.
Testing notes: