bmesh: weight colors layer not alway tracked properly #29451

Closed
opened 2011-11-29 18:34:38 +01:00 by Andrew Wiggin · 7 comments
Member

%%%MiikaH reported to me that it seems like BMesh is not generating CD_WEIGHT_MCOL layers on the tesselated faces based on the CD_WEIGHT_MLOOPCOL layers. I do recall seeing places in the code that should probably be handling this and weren't.

Additionally, I've discovered if CD_ID_MCOL and CD_TEXTURE_MCOL, which don't have corresponding loop color layers. From a quick look at the code, it looks like CD_ID_MCOL isn't used anymore, and CD_TEXTURE_MCOL looks like it is created and used during render only, so it might be fine as is, but it would be good for someone to spend a bit more time to confirm this, when addressing the above weight colors issue.%%%

%%%MiikaH reported to me that it seems like BMesh is not generating CD_WEIGHT_MCOL layers on the tesselated faces based on the CD_WEIGHT_MLOOPCOL layers. I do recall seeing places in the code that should probably be handling this and weren't. Additionally, I've discovered if CD_ID_MCOL and CD_TEXTURE_MCOL, which don't have corresponding loop color layers. From a quick look at the code, it looks like CD_ID_MCOL isn't used anymore, and CD_TEXTURE_MCOL looks like it is created and used during render only, so it might be fine as is, but it would be good for someone to spend a bit more time to confirm this, when addressing the above weight colors issue.%%%
Author
Member

Changed status to: 'Open'

Changed status to: 'Open'

%%%Could you give steps to redo a bug with weight colors?, on simple tests at least I couldn't get it to break.%%%

%%%Could you give steps to redo a bug with weight colors?, on simple tests at least I couldn't get it to break.%%%

%%%This issue mostly affects Dynamic Paint 3D view preview code, and it's not "repeatable" with test files.

In trunk, I used CD_WEIGHT_MCOL data layer to save the preview from the modifier and it is automatically preserved for opengl drawing code through modifier stack.

In case of bmesh, it is outputted to "CD_WEIGHT_MLOOPCOL" loop data layer to even possibly be transferred to other modifiers etc. (See i.e. dynamicpaint.c line 1563->) However, currently that WEIGHT_MCOL layer doesn't get generated from the WEIGHT_MLOOPCOL data, and is therefore not available for the opengl draw code.

Currently "Weight Paint mode" has a special setup to regenerate both MCOL and MLOOPCOL for every modfier through DerivedMesh.c -> add_weight_mcol_dm().

I think it should work like this:

  • Weight Paint mode only outputs the CD_WEIGHT_MLOOPCOL from add_weight_mcol_dm().
  • Dynamic Paint also outputs the "CD_WEIGHT_MLOOPCOL".
  • Customdata code should automatically generate "CD_WEIGHT_MCOL" from that loop data like it does for the basic "CD_MLOOPCOL" layer etc.

I think it might also be good idea to rename those weight layers to something general for 3d view drawing only, because that's what they are is used for. Having a WEIGHT in the name is quite confusing already since it only stores colors. For example CD_OPENGL_MLOOPCOL or CD_PREVIEW_MLOOPCOL would describe it better and would better fit also for tools like Dynamic Paint etc. :)%%%

%%%This issue mostly affects Dynamic Paint 3D view preview code, and it's not "repeatable" with test files. In trunk, I used CD_WEIGHT_MCOL data layer to save the preview from the modifier and it is automatically preserved for opengl drawing code through modifier stack. In case of bmesh, it is outputted to "CD_WEIGHT_MLOOPCOL" loop data layer to even possibly be transferred to other modifiers etc. (See i.e. dynamicpaint.c line 1563->) However, currently that WEIGHT_MCOL layer doesn't get generated from the WEIGHT_MLOOPCOL data, and is therefore not available for the opengl draw code. Currently "Weight Paint mode" has a special setup to regenerate both MCOL and MLOOPCOL for every modfier through DerivedMesh.c -> add_weight_mcol_dm(). I think it *should* work like this: * Weight Paint mode *only* outputs the CD_WEIGHT_MLOOPCOL from add_weight_mcol_dm(). * Dynamic Paint also outputs the "CD_WEIGHT_MLOOPCOL". * Customdata code should automatically generate "CD_WEIGHT_MCOL" from that loop data like it does for the basic "CD_MLOOPCOL" layer etc. I think it might also be good idea to rename those weight layers to something general for 3d view drawing only, because that's what they are is used for. Having a WEIGHT in the name is quite confusing already since it only stores colors. For example CD_OPENGL_MLOOPCOL or CD_PREVIEW_MLOOPCOL would describe it better and would better fit also for tools like Dynamic Paint etc. :)%%%

%%%Think this one is also related to [#30234]…%%%

%%%Think this one is also related to [#30234]…%%%

%%%Moved from BMesh Branch 2.6x Bug Trackers to Blender 2.6 Bug Tracker%%%

%%%Moved from BMesh Branch 2.6x Bug Trackers to Blender 2.6 Bug Tracker%%%

%%%Think we can close that one, should be fixed in svn44978 (else, just reopen!).%%%

%%%Think we can close that one, should be fixed in svn44978 (else, just reopen!).%%%

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
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
4 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#29451
No description provided.