object.to_mesh ignores object.update_from_editmode #63244
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
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
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#63244
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?
System Information
Operating system: Windows-10-10.0.17134 64 Bits
Graphics card: GeForce GTX 860M/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 417.35
Blender Version
Broken: version: 2.80 (sub 53), branch: blender2.7, commit date: 2019-04-02 19:53, hash:
a813e259d6
Worked: This might be the cause
46eb5a0b8a
Short description of error
obj.update_from_editmode
updatesobj.data
but not the result of theobj.to_mesh
as it was before.bmesh.from_object
also does not update, but it did not work before unliketo_mesh
.Why there is no easy way of getting evaluated mesh from edit mode?
depsgraph.id_eval_get(obj).data
works only from object mode, andto_mesh
creates a whole new mesh datablock which I don't need.Exact steps for others to reproduce the error
1
selected face.1
face selected, unless you leave and re-enter edit mode.Added subscriber: @MikhailRachinskiy
Added subscriber: @TakeshiFunahashi
Added subscriber: @JoseConseco
Added subscriber: @MACHIN3
Added subscriber: @brecht
In order to properly get mesh with modifier applies the dependency graph is to be evaluated first. What happens in this script is that it does modify the original object (by doing
update_from_editmode
), but it does not inform dependency graph about it. There are two ways to go about it:update_from_editmode
:me = ob.to_mesh(bpy.context.depsgraph, False)
@brecht, do you think there is some way we should improve/change API here, or add some sanity checks?
This change in behaviour could be mentioned in 2.80 Py API Changes .
I will also create Q&A on stackexchange.
This might be enough to keep people informed.
@MikhailRachinskiy, agree. There is still a huge work to be done on documentation and release logs, and this indeed something what should be mentioned there.
I really thanks Mikhail make this report, and Sergey offer way how to up-date correctly.
There seems case, even though I do not use "update_from_editmode",
I need to add "ob.update_tag() bpy.context.view_layer.update()" in sipite of "ob.data.update()"
After that, function, which overwrite shape key data, suddenly work again.
(it seems break after this commit)
The "mesh" argument is, active_shape_ key.data of object.
then x = editted vertices with use object_to.mesh()
I still not clear understand when I actually need to use Sargey Recommend way.
then hope new API document follow these detail too.
Changed status from 'Open' to: 'Resolved'
Committed extra changes in
d4f12860aa
which makes this usecase a bit more simple.Here is a script ported to all the recent dependency graph API changes.
Thanks for the report, considering it solved now.