LuxRenderAddon.BL_IDNAME problem

Discussion related to the 'LuxBlend' Blender 2.4+ python exporter script.

Moderators: Ratow, SATtva, coordinators

LuxRenderAddon.BL_IDNAME problem

Postby dfelinto » Thu Apr 12, 2012 1:22 pm

Hi,
the LuxRender addon has a non-standard way of naming its bl_idname. The standard way would be LUXRENDER_RENDER (used by povray, renderfarm.if, ...). While the current name is luxrender.*version*[-dev].

The problem with this is that I'm writing an addon that need to get the current engine in Blender (bpy.context.scene.render.engine). If the current engine is luxrender I want to do something different than if it's cycles. Thus the need of a uniform name, version-free.

This can be defined in the //core/__init__.py, but all the UIs are checking COMPAT_ENGINES against LuxRenderAddon.BL_IDNAME so if you simply change this in the core file all the UI elements disappear.

Thanks
dfelinto
 
Posts: 3
Joined: Thu Apr 12, 2012 9:37 am

Re: LuxRenderAddon.BL_IDNAME problem

Postby jensverwiebe » Tue Apr 17, 2012 9:24 am

Bump for attract doug :)

JEns
User avatar
jensverwiebe
Developer
 
Posts: 2124
Joined: Wed Apr 02, 2008 4:34 pm

Re: LuxRenderAddon.BL_IDNAME problem

Postby jensverwiebe » Fri May 18, 2012 8:08 am

I commited this now according Dalai's request.

Changed all occurances of LuxRenderAddon.BL_IDNAME --> 'LUXRENDER_RENDER'

COMPAT_ENGINE now indeed 'LUXRENDER_RENDER'.
I tested it also inside blender panes, work fine.
Example:
Code: Select all
Index: release/scripts/startup/bl_ui/properties_data_camera.py
===================================================================
--- release/scripts/startup/bl_ui/properties_data_camera.py   (revision 46782)
+++ release/scripts/startup/bl_ui/properties_data_camera.py   (working copy)
@@ -109,8 +109,9 @@
         col.label(text="Clipping:")
         col.prop(cam, "clip_start", text="Start")
         col.prop(cam, "clip_end", text="End")
+        if context.scene.render.engine == 'LUXRENDER_RENDER':
+            col.prop(cam.luxrender_camera, "use_clipping", text="Use Clipping")

-
class DATA_PT_camera(CameraButtonsPanel, Panel):
     bl_label = "Camera"
     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}


resulting panel:
lens_pane_with_lux_property.jpg
lens_pane_with_lux_property.jpg (25.73 KiB) Viewed 796 times



Pls check if i overlooked something.

Jens
User avatar
jensverwiebe
Developer
 
Posts: 2124
Joined: Wed Apr 02, 2008 4:34 pm


Return to LuxBlend (Blender Exporter)

Who is online

Users browsing this forum: No registered users and 2 guests