schroef / uvlayout_bridge

Blender Add-On: A bridge between Headus UVlayout and Blender
22 stars 2 forks source link

Issue when the object ins't included in the default collection #1

Closed Oxervision closed 2 years ago

Oxervision commented 5 years ago

Hi Rombout, I'm learning Blender 2.8 and I installed your version of uvlayout_bridge and I found an issue if the object isn't include in the default collection. macOS 11.13.6 & uvlayout_bridge 0.6.4 & Blender 2.80.45 Error message:

Traceback (most recent call last):
  File "/Users/Oxer/Library/Application Support/Blender/2.80/scripts/addons/uvlayout_bridge/__init__.py", line 772, in execute
    UVL_IO()
  File "/Users/Oxer/Library/Application Support/Blender/2.80/scripts/addons/uvlayout_bridge/__init__.py", line 424, in UVL_IO
    objexcl = gather_objects(bpy.context.scene)
  File "/Users/Oxer/Library/Application Support/Blender/2.80/scripts/addons/uvlayout_bridge/__init__.py", line 417, in gather_objects
    if (not no_export(obj)):
  File "/Users/Oxer/Library/Application Support/Blender/2.80/scripts/addons/uvlayout_bridge/__init__.py", line 399, in no_export
    return (not obj.hide_viewport) and (not obj.hide_select) and layers_intersect(obj, scene) and obj.visible_get(scene)
  File "/Users/Oxer/Library/Application Support/Blender/2.80/scripts/addons/uvlayout_bridge/__init__.py", line 392, in layers_intersect
    return any(l0 and l1 for l0, l1 in zip(getattr(a, name_a), getattr(b, name_b or name_a)))
AttributeError: 'Object' object has no attribute 'collection'

location: <unknown location>:-1

To Reproduce Steps to reproduce the behavior:

  1. Select the object (whitout collection / included in antoher collection / different to default collection)
  2. Click on 'Unwrap in UVlayout >'

It's very easy fix the issue, to move it to the default collection, for that it would be a good idea to add an alert when the object isn't included in the default collection. If the object is included in another collection, it appears the same error message.

schroef commented 5 years ago

@Oxervision , thanks for the finding. I had a quick look at it. I think for now ill leave this function out perhaps. I need to check and read up on how this all works in depth.

Oxervision commented 5 years ago

Thanks for the reply, are you working on TheaForBlender update for Blender 2.8?

schroef commented 5 years ago

Not yet, i want to do some more small addon before i tackle this big one.

schroef commented 5 years ago

@Oxervision

Hi i think i got it now. I also fixed a other issue where i got an error when "use selection" was off. It would cause an error for none mesh types (camera, lights etc) Try this versions #bl2_80

Oxervision commented 5 years ago

Thanks Rombout, I will test it and I'll inform you