Regression: Bones drawn as stick are invisible #115930

Closed
opened 2023-12-08 11:51:14 +01:00 by lucas veber · 15 comments

System Information
Operating system: Windows-10-10.0.19045-SP0 64 Bits
Graphics card: NVIDIA GeForce GTX 1080/PCIe/SSE2 NVIDIA Corporation 4.6.0 NVIDIA 536.99

Blender Version
Broken: version: 4.0.2, branch: blender-v4.0-release, commit date: 2023-12-05 07:41, hash: 9be62e85b727
Worked: 3.6.5

Short description of error
Bones drawn as Stick are invisible when unselected (see Gif attached)

Exact steps for others to reproduce the error

  • Open the blend file (was created with earlier versions of Blender).
  • On the right, switch "Display As" from Octahedral to Stick
  • Bones become invisible
  • Note: when switching to Edit mode and selecting them, they are visible. In Object mode too.

Seems to be related to this, but it is persisting:
#115434

**System Information** Operating system: Windows-10-10.0.19045-SP0 64 Bits Graphics card: NVIDIA GeForce GTX 1080/PCIe/SSE2 NVIDIA Corporation 4.6.0 NVIDIA 536.99 **Blender Version** Broken: version: 4.0.2, branch: blender-v4.0-release, commit date: 2023-12-05 07:41, hash: `9be62e85b727` Worked: 3.6.5 **Short description of error** Bones drawn as Stick are invisible when unselected (see Gif attached) **Exact steps for others to reproduce the error** - Open the blend file (was created with earlier versions of Blender). - On the right, switch "Display As" from Octahedral to Stick - Bones become invisible - Note: when switching to Edit mode and selecting them, they are visible. In Object mode too. Seems to be related to this, but it is persisting: https://projects.blender.org/blender/blender/issues/115434
lucas veber added the
Priority
Normal
Type
Report
Status
Needs Triage
labels 2023-12-08 11:51:15 +01:00
Iliya Katushenock added the
Interest
Animation & Rigging
Interest
EEVEE & Viewport
labels 2023-12-08 13:32:47 +01:00
Iliya Katushenock changed title from Bones drawn as stick are invisible to Regression: Bones drawn as stick are invisible 2023-12-08 13:33:11 +01:00

Seems fixed in 4.1
From what I can see, c9093332e0 has not been backported.
@nathanvegdahl, @Jeroen-Bakker is backporting that commit into 4.0 viable?

Seems fixed in 4.1 From what I can see, c9093332e0 has not been backported. @nathanvegdahl, @Jeroen-Bakker is backporting that commit into 4.0 viable?
Member

It is possible, but it needs to be done manually due to the file versioning code.

It is possible, but it needs to be done manually due to the file versioning code.
Author

The bug is persisting in 4.1
Please see files attached

The bug is persisting in 4.1 Please see files attached

Also seeing this same behavior in 4.11. Stick bones are only visible when selected. Displaying as "Wire" still works in the meantime, but Sticks are easier to work with.

Also seeing this same behavior in 4.11. Stick bones are only visible when selected. Displaying as "Wire" still works in the meantime, but Sticks are easier to work with.
Member

Yes I see.

When saving the file in Blender 4.0 and then opening it in Blender 4.1 will fix the issue.
I think that the versioning code isn't running for this file or that there is still a operation that doesn't set the correct alpha value.

@nathanvegdahl can you have a look at it?

I tagged the animation module as its is data related.

Yes I see. When saving the file in Blender 4.0 and then opening it in Blender 4.1 will fix the issue. I think that the versioning code isn't running for this file or that there is still a operation that doesn't set the correct alpha value. @nathanvegdahl can you have a look at it? I tagged the animation module as its is data related.
Member

Yeah, I'll take a look.

Yeah, I'll take a look.
Member

@LucasVeber Can you provide steps for how you created that file? For example, what Blender version(s) did you use, and the steps you took to create the armature and set the bone colors?

@LucasVeber Can you provide steps for how you created that file? For example, what Blender version(s) did you use, and the steps you took to create the armature and set the bone colors?
Author

@nathanvegdahl Yes sure, thanks for looking into it.
This file was initially saved with Blender 2.93.
Color groups were defined with scripts, such as:

grp.colors.normal = grp_color
for col_idx in range(0,3):
    grp.colors.select[col_idx] = grp_color[col_idx] + custom_highlight[0]
    grp.colors.active[col_idx] = grp_color[col_idx] + custom_highlight[1]

Color property:
bpy.types.Scene.grp_color= FloatVectorProperty(name="Color", subtype="COLOR_GAMMA", default=(0.602, 0.667, 1.0), min=0.0, max=1.0 )

However, if these backward compat issues are too much of a problem, I've just found a workaround.
I open the file under Blender 2.93 and run this script that switch the "color_set" to the first theme, to reset colors data, then switch back to Custom

obj = bpy.context.active_object

for grp in obj.pose.bone_groups:
    cur_cols = grp.colors.normal.copy(), grp.colors.select.copy(), grp.colors.active.copy()
    
    if grp.color_set == 'CUSTOM':
        grp.color_set = 'THEME01'
        grp.color_set = 'CUSTOM'
        grp.colors.normal, grp.colors.select, grp.colors.active = cur_cols

Seems to fix it for now.

@nathanvegdahl Yes sure, thanks for looking into it. This file was initially saved with Blender 2.93. Color groups were defined with scripts, such as: ``` grp.colors.normal = grp_color for col_idx in range(0,3): grp.colors.select[col_idx] = grp_color[col_idx] + custom_highlight[0] grp.colors.active[col_idx] = grp_color[col_idx] + custom_highlight[1] ``` Color property: `bpy.types.Scene.grp_color= FloatVectorProperty(name="Color", subtype="COLOR_GAMMA", default=(0.602, 0.667, 1.0), min=0.0, max=1.0 )` However, if these backward compat issues are too much of a problem, I've just found a workaround. I open the file under Blender 2.93 and run this script that switch the "color_set" to the first theme, to reset colors data, then switch back to Custom ``` obj = bpy.context.active_object for grp in obj.pose.bone_groups: cur_cols = grp.colors.normal.copy(), grp.colors.select.copy(), grp.colors.active.copy() if grp.color_set == 'CUSTOM': grp.color_set = 'THEME01' grp.color_set = 'CUSTOM' grp.colors.normal, grp.colors.select, grp.colors.active = cur_cols ``` Seems to fix it for now.
Member

I've done some investigation:

  • The file provided by @LucasVeber has file version 401 and subversion 23, which is later than the versioning code that fixes the zero-alpha custom bone colors (401, 9). This is why the versioning code doesn't run to fix it.
  • This suggests that there is still some way of creating bones with zero-alpha custom bone colors in Blender versions after the previous fix (#115477).
  • Diving into the relevant code, I haven't yet been able to find where this is possible.
  • Via testing, I also haven't been able to create such bones. I've tried the following things so far:
    • The standard way of creating bones (add, duplicate, extrude).
    • Creating bones via Python.
    • Creating an armature in previous Blender versions prior to the fix (both 3.x and 4.0.x), and opening/appending/linking-and-making-local.

At this point I'm at a bit of a loss. Repro steps for how to create a blend file that exhibits this issue would be extremely helpful (@LucasVeber @Micah-Ganske ?). And if anyone else has ideas of what to try, I'm all ears.

I will continue investigating as I have time.

I've done some investigation: - The file provided by @LucasVeber has file version 401 and subversion 23, which is later than the versioning code that fixes the zero-alpha custom bone colors (401, 9). This is why the versioning code doesn't run to fix it. - This suggests that there is still some way of creating bones with zero-alpha custom bone colors in Blender versions after the previous fix (#115477). - Diving into the relevant code, I haven't yet been able to find where this is possible. - Via testing, I also haven't been able to create such bones. I've tried the following things so far: - The standard way of creating bones (add, duplicate, extrude). - Creating bones via Python. - Creating an armature in previous Blender versions prior to the fix (both 3.x and 4.0.x), and opening/appending/linking-and-making-local. At this point I'm at a bit of a loss. Repro steps for how to create a blend file that exhibits this issue would be extremely helpful (@LucasVeber @Micah-Ganske ?). And if anyone else has ideas of what to try, I'm all ears. I will continue investigating as I have time.
Member

Ah, thanks @LucasVeber!

Ah, thanks @LucasVeber!
Author

No problems!
In the given file, the 2.93 armature was imported directly into the Blender 4 file, using python too.
I guess this is why the automatic versioning modifications were not applied.

I'd appreciate to know if it can be fixed anyway. For files that have been already saved in Blender 4. Is there a way to set this alpha value to 1 via python, or something? I cannot seem to find any.

No problems! In the given file, the 2.93 armature was imported directly into the Blender 4 file, using python too. I guess this is why the automatic versioning modifications were not applied. I'd appreciate to know if it can be fixed anyway. For files that have been already saved in Blender 4. Is there a way to set this alpha value to 1 via python, or something? I cannot seem to find any.

Ah, interesting! I didn't realize bones even had alpha values. Luckily, or maybe unluckily for bug fixing, the issue suddenly resolved itself on my end. The rig in question was generated with auto-rig pro though, so the add-on was doing it's own thing in the background each time I edited the reference skeleton. Thank you all!

Ah, interesting! I didn't realize bones even had alpha values. Luckily, or maybe unluckily for bug fixing, the issue suddenly resolved itself on my end. The rig in question was generated with auto-rig pro though, so the add-on was doing it's own thing in the background each time I edited the reference skeleton. Thank you all!
Author

@nathanvegdahl isn't there a way to modify the source code so that the Stick display mode always draws the alpha channel with 255 value, like other display modes? B-Bone, Envelope, Octahedral and Wire are fine... Stick is the only one that has this alpha channel bug.

@nathanvegdahl isn't there a way to modify the source code so that the Stick display mode always draws the alpha channel with 255 value, like other display modes? B-Bone, Envelope, Octahedral and Wire are fine... Stick is the only one that has this alpha channel bug.
Member

@LucasVeber Yeah, I think that's the best fix here. There was other code that was also modified recently to work that way, that fixed similar drawing issues elsewhere. I'll look into that soon.

Ah, interesting! I didn't realize bones even had alpha values.

Well, conceptually they don't, which is why that's not exposed in the UI. The colors are just incidentally stored as four bytes internally for some reason.

@LucasVeber Yeah, I think that's the best fix here. There was other code that was also modified recently to work that way, that fixed similar drawing issues elsewhere. I'll look into that soon. > Ah, interesting! I didn't realize bones even had alpha values. Well, conceptually they don't, which is why that's not exposed in the UI. The colors are just incidentally stored as four bytes internally for some reason.
Nathan Vegdahl self-assigned this 2024-04-30 12:06:17 +02:00
Blender Bot added
Status
Resolved
and removed
Status
Confirmed
labels 2024-04-30 15:25:36 +02:00
Author

Amazing, thanks @nathanvegdahl !

Amazing, thanks @nathanvegdahl !
Sign in to join this conversation.
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
5 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#115930
No description provided.