Python docs about RenderEngine: importing properties_render Python module is incorrect #27740

Closed
opened 2011-06-23 20:35:32 +02:00 by Michalis Kamburelis · 3 comments

%%%This is about the example Python code on RenderEngine class documentation page: http://www.blender.org/documentation/blender_python_api_2_58_release/bpy.types.RenderEngine.html

Pasting the example code and trying to run (Alt+P) says that "properties_render" module is not found. The ending of the script should be replaced now with

bpy.types.RENDER_PT_render.COMPAT_ENGINES.add('custom_renderer')
bpy.types.MATERIAL_PT_preview.COMPAT_ENGINES.add('custom_renderer')

That is, no need to import any module, just access stuff through bpy.types. Attaching simple patch to doc/python_api/examples/bpy.types.RenderEngine.py that does it.

(Sidenote: first I had an idea for another workaround, by adding

import sys
sys.path.append('/scripts/startup/bl_ui/')

to the script. This makes the script execute but is still incorrect. This defines new RENDER_PT_render class, that isn't registered, and extending it's COMPAT_ENGINES doesn't do anything.)

The problem and solution tested with Blender 2.58, on Linux (Debian lenny (oldstable)), 32-bit.%%%

%%%This is about the example Python code on RenderEngine class documentation page: http://www.blender.org/documentation/blender_python_api_2_58_release/bpy.types.RenderEngine.html Pasting the example code and trying to run (Alt+P) says that "properties_render" module is not found. The ending of the script should be replaced now with bpy.types.RENDER_PT_render.COMPAT_ENGINES.add('custom_renderer') bpy.types.MATERIAL_PT_preview.COMPAT_ENGINES.add('custom_renderer') That is, no need to import any module, just access stuff through bpy.types. Attaching simple patch to doc/python_api/examples/bpy.types.RenderEngine.py that does it. (Sidenote: first I had an idea for another workaround, by adding import sys sys.path.append('<blender-install-path>/scripts/startup/bl_ui/') to the script. This makes the script execute but is still incorrect. This defines *new* RENDER_PT_render class, that isn't registered, and extending it's COMPAT_ENGINES doesn't do anything.) The problem and solution tested with Blender 2.58, on Linux (Debian lenny (oldstable)), 32-bit.%%%

Changed status to: 'Open'

Changed status to: 'Open'

%%%fixed r38210.%%%

%%%fixed r38210.%%%

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
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#27740
No description provided.