Hubs-Foundation / hubs-blender-exporter

The Hubs Blender Add-on enables artists to export their creations to the immersive web with Hubs
Mozilla Public License 2.0
165 stars 50 forks source link

Don't fail if a dependency does not exist #247

Closed keianhzo closed 1 year ago

keianhzo commented 1 year ago

If a dependency is already removed we are failing to remove and a confusing stacktrace is shown to the user. This PR makes us continue if a dependency doesn't exist maybe because it' been already manually removed.

Exairnous commented 1 year ago

But why is the dependency not there in the first place? There should be no way for a user to remove a dependency through the UI. Is this related to components in the BG add-on like BG Grabbable with its BG RigidBody and BG Physics Shape dependencies? If so and these are actual hard dependencies, then I think they need to have the isDependecy property set in their init function like so (or perhaps this property should be automatically set?):

    @classmethod
    def init(cls, obj):
        obj.hubs_component_list.items.get('rigidbody').isDependency = True

Otherwise, if they aren't hard dependencies, then we should probably introduce the concept of soft dependencies (e.g. components that are added with the main component that are likely to be useful, but aren't strictly required) and switch them to be soft.

keianhzo commented 1 year ago

Oh yeah, i forgot that we had that flag. That will make it. I'll close this. Thanks

Exairnous commented 1 year ago

You're welcome! Happy to help :)