Object propertys in interface let Blender crash when pressing CTRL+Z #44580

Closed
opened 2015-05-01 16:57:13 +02:00 by mic lack30 · 5 comments

Windows 7 x64,CPU i7 3820, 8 GB RAM, GPU 2x GTX680

Blender 2.74.5 (94d80c8)

I'm having a custom property assigned to an object and using that in a python interface script with layout.prop(data path to object, "Name of property"). When doing some actions in the viewport and undoing them with CTRL+Z Blender crashes. When having the custom properties in the scene data blender doesn't crash.

  • Open the .blend
  • Run the Script
  • Go a few times in the edit mode or just do any action you can undo
  • Press CTRL+Z

Blender crashes

Bug.blend

Windows 7 x64,CPU i7 3820, 8 GB RAM, GPU 2x GTX680 Blender 2.74.5 (94d80c8) I'm having a custom property assigned to an object and using that in a python interface script with layout.prop(data path to object, "Name of property"). When doing some actions in the viewport and undoing them with CTRL+Z Blender crashes. When having the custom properties in the scene data blender doesn't crash. - Open the .blend - Run the Script - Go a few times in the edit mode or just do any action you can undo - Press CTRL+Z # Blender crashes [Bug.blend](https://archive.blender.org/developer/F168962/Bug.blend)
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @michaellackner

Added subscriber: @michaellackner

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Bastien Montagne self-assigned this 2015-05-01 18:43:19 +02:00

You are storing bpy.data.objects["Cube"] in a global var in your py script… this is one of the best ways to get Blender crashing.

You shall never ever keep a static ref to some blender data in a script - many operations in Blender (including undo) will change addresses of data, so stored py var will reference invalid memory very quickly.

See also http://www.blender.org/api/blender_python_api_2_74_0/info_gotcha.html#help-my-script-crashes-blender and next sections.

You are storing bpy.data.objects["Cube"] in a global var in your py script… this is one of the best ways to get Blender crashing. You shall **never ever** keep a static ref to some blender data in a script - many operations in Blender (including undo) will change addresses of data, so stored py var will reference invalid memory very quickly. See also http://www.blender.org/api/blender_python_api_2_74_0/info_gotcha.html#help-my-script-crashes-blender and next sections.
Author

Wow.. wasn't aware of that.. Sorry for reporting that useless bug. Keep up that great work!

Wow.. wasn't aware of that.. Sorry for reporting that useless bug. Keep up that great work!
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 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#44580
No description provided.