Fix #106759: Error on running blender_icons_geom.py with curve #108647

Merged
Philipp Oeser merged 2 commits from lichtwerk/blender:106759 into blender-v3.6-release 2023-06-08 10:22:00 +02:00
Member

288e7d0af0 added support for legacy curves, these dont have attributes
though, but code was checking for an active color atttribute.

Now, only do this check (and skip that object) if it is a mesh (that
doesnt have vertex an active color atttribute).

288e7d0af0c2 added support for legacy curves, these dont have attributes though, but code was checking for an active color atttribute. Now, only do this check (and skip that object) if it is a mesh (that doesnt have vertex an active color atttribute).
Philipp Oeser added 1 commit 2023-06-06 09:49:02 +02:00
eb581c0281 Fix #106759: Error on running blender_icons_geom.py with curve
288e7d0af0 added support for legacy curves, these dont have attributes
though, but code was checking for an active color atttribute.

Now, only do this check (and skip that object) if it is a mesh (that
doesnt have vertex an active color atttribute).
Philipp Oeser added this to the User Interface project 2023-06-06 09:49:16 +02:00
Philipp Oeser requested review from Dalai Felinto 2023-06-06 09:49:23 +02:00
Philipp Oeser added the
Interest
Modeling
label 2023-06-06 09:49:33 +02:00
Dalai Felinto requested changes 2023-06-06 10:19:57 +02:00
Dalai Felinto left a comment
Owner

I would try something like this:

diff --git a/release/datafiles/blender_icons_geom.py b/release/datafiles/blender_icons_geom.py
index 45447892700..ae15dccae32 100644
--- a/release/datafiles/blender_icons_geom.py
+++ b/release/datafiles/blender_icons_geom.py
@@ -45,7 +45,7 @@ import bpy
 
 # Generic functions
 
-OBJECTS_TYPES_MESH_COMPATIBLE = {'CURVE', 'MESH'}
+OBJECTS_TYPES_MESH_COMPATIBLE = {'CURVE', 'CURVES', 'MESH'}
 
 
 def area_tri_signed_2x_v2(v1, v2, v3):
@@ -350,7 +350,7 @@ def main():
         if name.rpartition(".")[2].isdigit():
             continue
 
-        if not ob_eval.data.attributes.active_color:
+        if (not hasattr(ob_eval.data, 'attributes')) or not ob_eval.data.attributes.active_color:
             print("Skipping:", name, "(no vertex colors)")
             continue

I haven't tested it though, but this would make things a bit more future proof. Also notice that CURVES have attributes, while CURVE doesn't.

I would try something like this: ```diff diff --git a/release/datafiles/blender_icons_geom.py b/release/datafiles/blender_icons_geom.py index 45447892700..ae15dccae32 100644 --- a/release/datafiles/blender_icons_geom.py +++ b/release/datafiles/blender_icons_geom.py @@ -45,7 +45,7 @@ import bpy # Generic functions -OBJECTS_TYPES_MESH_COMPATIBLE = {'CURVE', 'MESH'} +OBJECTS_TYPES_MESH_COMPATIBLE = {'CURVE', 'CURVES', 'MESH'} def area_tri_signed_2x_v2(v1, v2, v3): @@ -350,7 +350,7 @@ def main(): if name.rpartition(".")[2].isdigit(): continue - if not ob_eval.data.attributes.active_color: + if (not hasattr(ob_eval.data, 'attributes')) or not ob_eval.data.attributes.active_color: print("Skipping:", name, "(no vertex colors)") continue ``` I haven't tested it though, but this would make things a bit more future proof. Also notice that CURVES have attributes, while CURVE doesn't.
Philipp Oeser added 1 commit 2023-06-06 11:12:22 +02:00
f7b66cedf5 be more general in checking existance of attribute
we could have other object types supported as well (e.g. curves -- which
I wont add in this commit to make this a pure bugfix)
Author
Member

Yeah, makes sense (I didnt add the support for curves in this commit though to make this a "pure" fix)

Yeah, makes sense (I didnt add the support for curves in this commit though to make this a "pure" fix)
Dalai Felinto approved these changes 2023-06-08 09:57:01 +02:00
Philipp Oeser merged commit 7ffd73100e into blender-v3.6-release 2023-06-08 10:22:00 +02:00
Philipp Oeser deleted branch 106759 2023-06-08 10:22:03 +02:00
Sign in to join this conversation.
No reviewers
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#108647
No description provided.