Can't read custom props set on bpy.types.RenderSettings #45934

Closed
opened 2015-08-28 04:03:37 +02:00 by Isaac Weaver · 7 comments

System Information
Operating System: Windows 8.1 64-bit
Graphics Card: Nvidia GeForce GT 620

Blender Version
Broken: 2.75a

Short description of error
If you set a custom property on bpy.types.RenderSettings, for example:

bpy.types.RenderSettings.custom_prop = bpy.props.IntProperty()

Then try to access it in the current scene, you'd expect the result to be 0 but instead you get (<built-in function IntProperty>, {}):

bpy.context.scene.render.custom_prop # result is (<built-in function IntProperty>, {}) instead of 0

Exact steps for others to reproduce the error
Open the attached blend file and press "Run Script". It should then raise an AssertionError.

**System Information** Operating System: Windows 8.1 64-bit Graphics Card: Nvidia GeForce GT 620 **Blender Version** Broken: 2.75a **Short description of error** If you set a custom property on `bpy.types.RenderSettings`, for example: ``` bpy.types.RenderSettings.custom_prop = bpy.props.IntProperty() ``` Then try to access it in the current scene, you'd expect the result to be `0` but instead you get `(<built-in function IntProperty>, {})`: ``` bpy.context.scene.render.custom_prop # result is (<built-in function IntProperty>, {}) instead of 0 ``` **Exact steps for others to reproduce the error** Open the attached blend file and press "Run Script". It should then raise an AssertionError.
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @IsaacWeaver

Added subscriber: @IsaacWeaver
Author

Forgot to attach the file: rendersettings_bug.blend

Forgot to attach the file: [rendersettings_bug.blend](https://archive.blender.org/developer/F228636/rendersettings_bug.blend)

Added subscriber: @mont29

Added subscriber: @mont29

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Bastien Montagne self-assigned this 2015-08-28 09:25:05 +02:00

Thnaks for the report, but no bug here, custom properties are only available for IDs (like Scene, but not RenderSettings) and a few other types like e.g. Bones. You cannot extend other types that way. I think what you want to do in this case is create a PropertyGroup gathering all your needed custom settings, and create a PropertyPointer in Scene for the group… Please see the doc for more details.

Thnaks for the report, but no bug here, custom properties are only available for IDs (like Scene, but not RenderSettings) and a few other types like e.g. Bones. You cannot extend other types that way. I think what you want to do in this case is create a PropertyGroup gathering all your needed custom settings, and create a PropertyPointer in Scene for the group… Please see [the doc](http://www.blender.org/api/blender_python_api_2_75_0/bpy.props.html) for more details.
Author

That should work perfect(maybe even better then my original idea :) Thanks for the clarification!

That should work perfect(maybe even better then my original idea :) Thanks for the clarification!
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#45934
No description provided.