Blender won't update mesh's usercount when deleting object datablocks in Editmode #53363

Closed
opened 2017-11-21 00:45:54 +01:00 by chaos · 8 comments
Member

System Information
Xubuntu 14.04
Nvidia GTX 750 Ti

Blender Version
Stable Blender 2.79. Hash: 5bd8ac9abfa

Short description of error
Blender won't update mesh's usercount when deleting object datablocks in Editmode.
I don't know if this is a bug or just expected behaviour in this context, but let's see.

Exact steps for others to reproduce the error

  1. Open up Blender, select the default Cube and enter Editmode

  2. In a console, just add the current object to a variable.

  cube = bpy.context.object
  1. Create a new object datablock using the data from the previous object. Now the Cube's mesh datablock has 2 users.
  linked = bpy.data.objects.new("linked", cube.data)
  1. Delete the newly created object.
  bpy.data.objects.remove(linked, do_unlink=True)

And now, as you can see in the Object Data context, the Cube still has 2 users, even though the other Object doesn't exist in the Blend File.
I didn't found any way to update the user count. But I think this is a bug, because there's no problem when doing this in Object Mode.

I found this bug because I can't use the ray_cast function in Edit Mode (I need to keep in this mode), and I'm forced to create a temporal copy to use the function and then, discard the object. But when doing so, the mesh data usercount gets messed, though I can confirm it doesn't use any extra memory.

**System Information** Xubuntu 14.04 Nvidia GTX 750 Ti **Blender Version** Stable Blender 2.79. Hash: 5bd8ac9abfa **Short description of error** Blender won't update mesh's usercount when deleting object datablocks in Editmode. I don't know if this is a bug or just expected behaviour in this context, but let's see. **Exact steps for others to reproduce the error** 1) Open up Blender, select the default Cube and enter Editmode 2) In a console, just add the current object to a variable. ``` cube = bpy.context.object ``` 3) Create a new object datablock using the data from the previous object. Now the Cube's mesh datablock has 2 users. ``` linked = bpy.data.objects.new("linked", cube.data) ``` 4) Delete the newly created object. ``` bpy.data.objects.remove(linked, do_unlink=True) ``` And now, as you can see in the Object Data context, the Cube still has 2 users, even though the other Object doesn't exist in the Blend File. I didn't found any way to update the user count. But I think this is a bug, because there's no problem when doing this in Object Mode. I found this bug because I can't use the ray_cast function in Edit Mode (I need to keep in this mode), and I'm forced to create a temporal copy to use the function and then, discard the object. But when doing so, the mesh data usercount gets messed, though I can confirm it doesn't use any extra memory.
Author
Member

Changed status to: 'Open'

Changed status to: 'Open'
Author
Member

Added subscriber: @chaos-4

Added subscriber: @chaos-4

Added subscriber: @zeauro

Added subscriber: @zeauro

I can reproduce the problem with 2.79 and master 69b5165.

It is really specific to edit mode.
It does not happen in Sculpt mode or Vertex paint mode, too.

I could see addition and deletion of object data in blend file view of outliner. But usercount is not updated.

I can reproduce the problem with 2.79 and master 69b5165. It is really specific to edit mode. It does not happen in Sculpt mode or Vertex paint mode, too. I could see addition and deletion of object data in blend file view of outliner. But usercount is not updated.
Member

Added subscribers: @mont29, @lichtwerk

Added subscribers: @mont29, @lichtwerk
Bastien Montagne was assigned by Philipp Oeser 2018-01-24 19:43:50 +01:00
Member

@mont29: mind having a look?

@mont29: mind having a look?

This issue was referenced by blender/blender@566eb60d81

This issue was referenced by blender/blender@566eb60d817da3e32661efda59b20f6f893ff7cc

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Sign in to join this conversation.
No Milestone
No project
No Assignees
5 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#53363
No description provided.