no way to know if a datablock is in editmode #35984

Closed
opened 2013-07-03 13:51:31 +02:00 by CodeManX · 4 comments
Member

%%%--- Operating System, Graphics card ---
Windows 7, 64bit

- Blender version with error ---

r57892

- Short description of error ---

If object is mode=='EDIT', bm.from_edit_mesh(me) is used to wrap the bmesh, is_wrapped should therefore be True.

If it's wrapped, bmesh.update_edit_mesh(me) needs to be called to flush changes instead of bm.to_mesh().

But neither works if a mesh object, that is a linked duplicate (same mesh datablock), is in editmode!

- Steps for others to reproduce the error (preferably based on attached .blend file) ---

Duplicate the default cube and run attached script. Enter edit mode and re-run. All fine.

Duplicate again and tick "Linked" in redo panel. Enter edit mode and re-run - it will complain about mesh being in editmode.

If you invert the condition to "if bm.is_wrapped", it will complain about mesh NOT being in editmode - so there is no way to write back changes!

It should be possible to do so without switching mode.%%%

%%%--- Operating System, Graphics card --- Windows 7, 64bit - Blender version with error --- r57892 - Short description of error --- If object is mode=='EDIT', bm.from_edit_mesh(me) is used to wrap the bmesh, is_wrapped should therefore be True. If it's wrapped, bmesh.update_edit_mesh(me) needs to be called to flush changes instead of bm.to_mesh(). But neither works if a mesh object, that is a linked duplicate (same mesh datablock), is in editmode! - Steps for others to reproduce the error (preferably based on attached .blend file) --- Duplicate the default cube and run attached script. Enter edit mode and re-run. All fine. Duplicate again and tick "Linked" in redo panel. Enter edit mode and re-run - it will complain about mesh being in editmode. If you invert the condition to "if bm.is_wrapped", it will complain about mesh NOT being in editmode - so there is no way to write back changes! It should be possible to do so without switching mode.%%%
Author
Member

Changed status to: 'Open'

Changed status to: 'Open'

%%%I think the real problem is that checking ob.mode == 'EDIT' is wrong, Blender only has one object in edit mode. Problem is there doesn't seem to be a way to check this, except for running bm.from_edit_mesh and seeing if an exception is generated.%%%

%%%I think the real problem is that checking ob.mode == 'EDIT' is wrong, Blender only has one object in edit mode. Problem is there doesn't seem to be a way to check this, except for running bm.from_edit_mesh and seeing if an exception is generated.%%%

%%%added 'is_editmode' property to meshes and other datatypes which support editmode r57980.
closing.%%%

%%%added 'is_editmode' property to meshes and other datatypes which support editmode r57980. closing.%%%

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Sign in to join this conversation.
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-addons#35984
No description provided.