Python docs about RenderEngine: importing properties_render Python module is incorrect #27740
Labels
No Label
Interest
Animation & Rigging
Interest
Blender Cloud
Interest
Collada
Interest
Core
Interest
Documentation
Interest
Eevee & Viewport
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
Import and Export
Interest
Modeling
Interest
Modifiers
Interest
Nodes & Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds, Tests & Devices
Interest
Python API
Interest
Rendering & Cycles
Interest
Sculpt, Paint & Texture
Interest
Translations
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Meta
Good First Issue
Meta
Papercut
Module
Add-ons (BF-Blender)
Module
Add-ons (Community)
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender-addons#27740
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
%%%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.%%%
Changed status to: 'Open'
%%%fixed r38210.%%%
Changed status from 'Open' to: 'Archived'