Reset values of property layer, when mesh is edited (after 2.74) #42865
Labels
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
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
8 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#42865
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hi All,
when you create your own property layer using e.g.:
and you assign some values to this layer, then these values are copied to some vertexes during extruding, duplicating, etc. It is OK in some cases, but developers IMHO usually want to handle theirs values (I want). Current behaviour does not allow to distinguish between existing vertices/edges/faces/loops and new created elements. BTW: I created following Python script for testing: https://gist.github.com/jirihnidek/bf0a8cb6bb2f306a39a7
I created patch that reset values in property layers of newly created vertices/edges/faces/loops. It will probably requires further modification of Python API and do not make such behaviour as default. I propose following modification:
customdata_prop_layer.diff
Changed status to: 'Open'
Added subscriber: @jiri
Not sure about this: we have a
set_default
callback already.We could just have a flag on the layer that defines duplicated elements are set to their default instead of copying from the data they came from.
Added subscriber: @JulianEisel
It sound reasonably. I will change the patch. Thanks for your feedback.
Hi All,
I created new version of patch. It adds one optional parameter to function
new()
:I updated previous gist file: https://gist.github.com/jirihnidek/bf0a8cb6bb2f306a39a7 to work with this patch.
Jiri
customdata_prop_layer_new.diff
I did some tests and it seems that new layer flag: CD_FLAG_NOCOPY_ELEM is forgotten, when object goes from object mode to edit mode.
The flag was cleared in CustomData_merge(). I'm attaching new patch file.
customdata_prop_layer_new2.diff
I'm attaching new patch that use attribute of layer (
lay.use_force_default = True
) for changing behaviour of custom-data layers in edit mode. Gist file with example is updated too.customdata_prop_layer_new3.diff
Checked latest patch. seems good, but would tweak names a bit before going into master. (
ufd
is a bit cryptic)Would like to do final check before going into master still.
Reset values of property layer, when mesh is editedto Reset values of property layer, when mesh is edited (after 2.74)Hi,
I extended the patch. It is also possible to get and set default value of custom-data layers using attribute, e.g.:
lay.default_value = -1
. Note: only int and float subtypes are supported, string subtype is not supported. When you try to get default value of other layer type (e.g.: UV), thenlay.default_value
returnsNone
.customdata_default_value.diff
I changed some typos and fixed wrong names of functions (caused by copy-paste).
Added subscriber: @HorusIceRaven
This comment was removed by @HorusIceRaven
@HorusIceRaven, we're currently not redesigning our layer system and tbh I don't see that happen soon. Thanks for the idea and the effort, we'll keep it in mind, it's just not the right time&place for it ;)
I understand, as I stated in the beginning. This message may have to be redirected or scrapped. My hope is only to improve by planting a seed that may grow into the form I depict or pieces may grow in a direction that no one could have foreseen.
Thanks for you rapid response.
I think you and your teem are doing a fantastic job, so to this.
Do what you will.
Added subscriber: @dfelinto
Added subscriber: @CodeManX
What's the status of the patch?
The parameter could also be called
propagate_values
IMO.Also interesting would be auto-increment as default value, so assign unique numbers (IDs) to vertices and disable value propagation...
Hi,
the status of this patch is following: I wait for @ideasman42 to approve it and merge to master. I poke him regularly at IRC chat ;-).
The name of parameter
default_value
is IMHO more descriptive thenpropagate_value
. I'm not big fan of auto-increment of layer values, because it duplicates functionality. Vertices, Edges, Faces, etc. have propertyindex
and it is unique.Cheers
Fingers crossed for this to land soon!
.index is not unique in the sense that it can change at any time (can even be overwritten by script) and does not persistently identify a geometry element over its lifetime. That's what I had in mind.
An auto-incrementing value would be unique and identify a vertex even after mesh sort operator.
Why fingers crossed? @ideasman42 approved first version of this patch (layer parameter
use_force_default
). Do you have anything against this patch? If so, you should clarify what is wrong.You are right about uniqueness of
index
, but I'm not willing to add auto-increment functionality to this patch. May be it could be implemented in another patch.Don't get me wrong, your patch is great! It's just that I've seen ready patches lurking around for months or even a year. So the emphasis was on "soon"!
Aha, I understand now :-). Fingers crossed gesture is not Batsu gesture.
@HorusIceRaven, your comments about layers re-design are unrelated to this patch, and off topic.
removed, pasted here, http://www.pasteall.org/60563 for reference.
Hi @ideasman42,
I refactored code for setting/getting
default_value
it is possible to set/get default values forint
,float
and nowstring
custom property layers, but there are other layer types. What other layer types should be supported? I'm adding all layer types accessible using Python API:CD_MDEFORMVERT
CD_PAINT_MASK
CD_MTEXPOLY
CD_MLOOPUV
CD_MLOOPCOL
CD_SHAPEKEY
CD_BWEIGHT
CD_CREASE
CD_MVERT_SKIN
Thanks.
Added subscriber: @SwoorupJoshi
Removed subscriber: @ideasman42
Added subscriber: @RobinKauffman
Changed status from 'Confirmed' to: 'Archived'
Hi, thanks for your patch.
We are undergoing a Tracker Curfew where we are automatically closing old patches.
If you think the patch is still relevant please update and re-submit it. For new features make sure there is a clear design from the user level perspective.