Page MenuHome

Undo breaks Property stored per Object
Closed, ArchivedPublic

Description

System Information
Windows 10.0.16299 (x64)
NVIDIA GTX460M

Blender Version
Broken: 2.79 5bd8ac9 (x64), and latest 2.79a release candidate
Worked: (optional)

Short description of error
Blender has random behavior when changing values of built in Property (IntProperty, FloatProperty, etc..) after Undo operation is performed. Random behavior:
Crash (rare)
Value Defaults to default and cannot be changed (less common)
Value Defaults to Default (most common)
Value behaves as expected (less common)

Exact steps for others to reproduce the error

  1. Start default blend file.
  2. Add or use existing cube, select it.
  3. Open Python console and enter:
obj = bpy.context.object
bpy.types.Object.id = bpy.props.IntProperty()
obj.id = 1234
obj.id
  1. Move the cube, place it. Move it again and place it.
  2. Ctrl+Z to undo last move.

obj.id - now will have random behavior. Sometimes assigning obj.id a new value or trying to print it will crash / freeze Blender. Most of the time the value will change to default. Sometimes it will stay the same.

It is even worse when storing data like so:

obj['my_id'] = 12345

Event Timeline

Here are some videos of some of the issues.
This one results in a crash.

In this one after undo, editing mesh in edit mode also resets the property.

Valeri Barashkov (valera) renamed this task from Undo brakes Property stored per Object to Undo breaks Property stored per Object.Feb 25 2018, 7:05 PM
Bastien Montagne (mont29) changed the task status from Unknown Status to Archived.Feb 26 2018, 9:51 AM
Bastien Montagne (mont29) claimed this task.

Thanks for the report, but no bug here. Undo/redos invalidate any data-block you may have kept in python, that why we say to never, ever keep a data-block by 'object', only by its name (and retrieve it from relevant bpy.data.... when you need it again). See the API doc for more details.

Does this also extend to the Property changes through the interface? Because in my testing I have not had any issues that way..