Various problems with CD layers and tesselation, related to modifiers stack #30234

Closed
opened 2012-02-17 19:43:21 +01:00 by Bastien Montagne · 11 comments

Relates to: #30234 #30266 #29451

%%%Hi Andrew, posting here as Campbell advised me you were the guy for this area, and I couldn’t catch you on IRC.

To see the problem, simply open the default scene and switch to Weight Paint mode. Instead of a blue cube, you get a black one.

You can find similar problems in various modifiers setup involving custom data layers (e.g. dynapaint’s demos, weightvg’s demos, an UVProject after a subsurf, etc.).

First part of the problem is that, at the end of the mod stack func (mesh_calc_modifiers), the finaldm is only re-tesselated if it has no tessfaces already.

So I coded a function to only update CD layers, without re-tesselating, to catch that kind of situations. And there I faced another one: quite often, finaldm has tessfaces, but no CD_POLYINDEX layer, which I think is a bug. This happens e.g. because subsurf (i.e. CCGDM) does not generate that layer currently when it does its own tesselation, and also because that layer was not protected during copying of dm in stack evaluation…

The attached patch addresses all the problems I could find out, but I finally wonder if we shouldn’t just unconditionally retesselate at the end of the mod stack? Or else, review all modifiers that actually affect topology, so that they really invalidate tesselated data (or just do it as soon as we have a constructive one in stack)? %%%

**Relates to**: #30234 #30266 #29451 %%%Hi Andrew, posting here as Campbell advised me you were the guy for this area, and I couldn’t catch you on IRC. To see the problem, simply open the default scene and switch to Weight Paint mode. Instead of a blue cube, you get a black one. You can find similar problems in various modifiers setup involving custom data layers (e.g. dynapaint’s demos, weightvg’s demos, an UVProject after a subsurf, etc.). First part of the problem is that, at the end of the mod stack func (mesh_calc_modifiers), the finaldm is only re-tesselated if it has no tessfaces already. So I coded a function to only update CD layers, without re-tesselating, to catch that kind of situations. And there I faced another one: quite often, finaldm has tessfaces, but no CD_POLYINDEX layer, which I think is a bug. This happens e.g. because subsurf (i.e. CCGDM) does not generate that layer currently when it does its own tesselation, and also because that layer was not protected during copying of dm in stack evaluation… The attached patch addresses all the problems I could find out, but I finally wonder if we shouldn’t just unconditionally retesselate at the end of the mod stack? Or else, review all modifiers that actually affect topology, so that they really invalidate tesselated data (or just do it as soon as we have a constructive one in stack)? %%%
Author
Owner

Changed status to: 'Open'

Changed status to: 'Open'
Author
Owner

%%%As a side note, it should also fix [#29451].%%%

%%%As a side note, it should also fix [#29451].%%%
Author
Owner

%%%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%%%
Author
Owner

%%%Updated patch against 44275 of trunk, and moving that bug into main tracker!%%%

%%%Updated patch against 44275 of trunk, and moving that bug into main tracker!%%%
Author
Owner

%%%Updating %%%

%%%Updating %%%

%%%Discussed with Bastien

requested that we have a flag in DM so that tessface data can be tagged as out of date so its not recalculated always (would slow down subsurf a lot I would think).
%%%

%%%Discussed with Bastien requested that we have a flag in DM so that tessface data can be tagged as out of date so its not recalculated always (would slow down subsurf a lot I would think). %%%
Author
Owner

%%%Updated patch to r44744, adding a dirty enum flag to DM (this way, wae can easily add other dirty flags later, if needed).

Side note: I’m not sure it’s related, but we still have problems with particules and subsurf modifier (i.e. dynapaint demo works well and gets nice weight preview, but not particles, as long as subsurf is there)… :/%%%

%%%Updated patch to r44744, adding a dirty enum flag to DM (this way, wae can easily add other dirty flags later, if needed). Side note: I’m not sure it’s related, but we still have problems with particules and subsurf modifier (i.e. dynapaint demo works well and gets nice weight preview, but not particles, as long as subsurf is there)… :/%%%

%%%@Bastien
Yes, hard to say if that is related or not. Particles or hair don't work at all if there is a subsurf modifier and dynamic paint in the stack earlier, weights seem to have nothing to do with it. Also it seems to be very random - just changing the subsurf level randomly works. After short investigation I have no idea why that is happening. :s%%%

%%%@Bastien Yes, hard to say if that is related or not. Particles or hair don't work at all if there is a subsurf modifier and dynamic paint in the stack earlier, weights seem to have nothing to do with it. Also it seems to be very random - just changing the subsurf level randomly works. After short investigation I have no idea why that is happening. :s%%%
Author
Owner

%%%Updated patch against r44907, and removed customdata changes.%%%

%%%Updated patch against r44907, and removed customdata changes.%%%
Author
Owner

%%%Patch committed as r44978, closing.%%%

%%%Patch committed as r44978, closing.%%%
Author
Owner

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
3 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#30234
No description provided.