Look here for latest blender2.5-api adaptions !!

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

Moderators: Dade, Ratow, SATtva, coordinators

Look here for latest blender2.5-api adaptions !!

Postby jensverwiebe » Mon Jul 12, 2010 3:26 am

Hi

This thread is now opened to collect needed changes to our exporters ( smalllux and luxblend 2.5 ) due blender-api changes.

Pls report issues and fixes here.

I start with 2 latest changes:

Hi

Here´s the latest diff/patch for blender-api-adaption ( matrix -> matrix_world ) for luxblend2.5:


Code: Select all
diff -r 756abfa66c97 src/luxrender/__main__.py
--- a/src/luxrender/__main__.py   Wed Jun 02 20:11:22 2010 +0100
+++ b/src/luxrender/__main__.py   Tue Jul 06 21:22:36 2010 +0200
@@ -313,9 +313,9 @@
          is_cam_animated = False
          if scene.camera.data.luxrender_camera.usemblur and scene.camera.data.luxrender_camera.cammblur:
             scene.set_frame(scene.frame_current + 1)
-            m1 = scene.camera.matrix.copy()
+            m1 = scene.camera.matrix_world.copy()
             scene.set_frame(scene.frame_current - 1)
-            if m1 != scene.camera.matrix:
+            if m1 != scene.camera.matrix_world:
                l.transformBegin(file=Files.MAIN)
                ws = get_worldscale(scene=scene)
                matrix *= ws
diff -r 756abfa66c97 src/luxrender/export/film.py
--- a/src/luxrender/export/film.py   Wed Jun 02 20:11:22 2010 +0100
+++ b/src/luxrender/export/film.py   Tue Jul 06 21:22:36 2010 +0200
@@ -38,7 +38,7 @@
    Returns      tuple(9) (floats)
    '''
    
-   matrix = scene.camera.matrix.copy()
+   matrix = scene.camera.matrix_world.copy()
    ws = get_worldscale(scene=scene)
    matrix *= ws
    ws = get_worldscale(scene=scene, as_scalematrix=False)
diff -r 756abfa66c97 src/luxrender/export/geometry.py
--- a/src/luxrender/export/geometry.py   Wed Jun 02 20:11:22 2010 +0100
+++ b/src/luxrender/export/geometry.py   Tue Jul 06 21:22:36 2010 +0200
@@ -245,7 +245,7 @@
          for dupli_ob in ob.dupli_list:
             if dupli_ob.object.type != 'MESH':
                continue
-            exportMesh(l, scene, dupli_ob.object, dupli_ob.matrix, smoothing_enabled)
+            exportMesh(l, scene, dupli_ob.object, dupli_ob.matrix_world, smoothing_enabled)
             if dupli_ob.object.name not in duplis:
                duplis.append(dupli_ob.object.name)
          
@@ -281,7 +281,7 @@
 
       # dupli object render rule copied from convertblender.c (blender internal render)      
       if (not ob.duplis_used or ob.dupli_type == 'DUPLIFRAMES') and render_emitter and (ob.name not in duplis):
-         exportMesh(l, scene, ob, ob.matrix, smoothing_enabled)
+         exportMesh(l, scene, ob, ob.matrix_world, smoothing_enabled)
 
       # exported another object      
       ipc += 1.0
diff -r 756abfa66c97 src/luxrender/export/lights.py
--- a/src/luxrender/export/lights.py   Wed Jun 02 20:11:22 2010 +0100
+++ b/src/luxrender/export/lights.py   Tue Jul 06 21:22:36 2010 +0200
@@ -199,7 +199,7 @@
          for dupli_ob in ob.dupli_list:
             if dupli_ob.object.type != 'LAMP':
                continue
-            have_light |= exportLights(l, scene, dupli_ob.object, dupli_ob.matrix)
+            have_light |= exportLights(l, scene, dupli_ob.object, dupli_ob.matrix_world)
 
          # free object dupli list again. Warning: all dupli objects are INVALID now!
          if ob.dupli_list:
@@ -208,7 +208,7 @@
          if ob.type != 'LAMP':
             continue
 
-         have_light |= exportLights(l, scene, ob, ob.matrix)
+         have_light |= exportLights(l, scene, ob, ob.matrix_world)
 
    return have_light
       


This is the EF patch for no_bg --> emboss, for fixing not shown gui-elements.
Important: it is inverted now !!


Code: Select all
diff -r dcab2b3ec862 ef/ui.py
--- a/ef/ui.py   Mon May 10 12:43:23 2010 +0100
+++ b/ef/ui.py   Wed Jul 07 14:18:24 2010 +0200
@@ -151,7 +151,7 @@
                            icon_only=pr['icon_only'] if 'icon_only' in pr.keys() else False,
                            event=pr['event'] if 'event' in pr.keys() else False,
                            full_event=pr['full_event'] if 'full_event' in pr.keys() else False,
-                           no_bg=pr['no_bg'] if 'no_bg' in pr.keys() else False,
+                           emboss=pr['emboss'] if 'emboss' in pr.keys() else True,
                         )
                      if pr['type'] in ['bool']:
                         pg = getattr(context, self.property_group.__name__)
@@ -163,7 +163,7 @@
                            icon_only=pr['icon_only'] if 'icon_only' in pr.keys() else False,
                            event=pr['event'] if 'event' in pr.keys() else False,
                            full_event=pr['full_event'] if 'full_event' in pr.keys() else False,
-                           no_bg=pr['no_bg'] if 'no_bg' in pr.keys() else False,
+                           emboss=pr['emboss'] if 'emboss' in pr.keys() else True,
                         )
                      elif pr['type'] in ['operator']:
                         layout.operator(pr['operator'],
diff -r dcab2b3ec862 ef/util/util.py
--- a/ef/util/util.py   Mon May 10 12:43:23 2010 +0100
+++ b/ef/util/util.py   Wed Jul 07 14:18:24 2010 +0200
@@ -119,7 +119,7 @@
    return True
 
 def scene_filename():
-   filename = os.path.splitext(os.path.basename(bpy.data.filename))[0]
+   filename = os.path.splitext(os.path.basename(bpy.data.filepath))[0]
    
    #return filename.replace('<','_').replace('>','_').replace(':','_')
    return bpy.utils.clean_name(filename)



I have no commitrights to this server, so pls feed it in yourself :)

Same for smallux-exporter : find and change matrix --> matrix_world



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

Re: Look here for latest blender2.5-api adaptions !!

Postby dougal2 » Thu Jul 15, 2010 7:09 am

Thanks Jens, these patches have now been applied to the repos.
User avatar
dougal2
Developer
 
Posts: 3131
Joined: Mon Jan 14, 2008 7:21 am

Re: Look here for latest blender2.5-api adaptions !!

Postby jensverwiebe » Fri Jul 16, 2010 5:40 pm

New change for blender > r30384 | campbellbarton | 2010-07-15 18:56:04 +0200 (Do, 15 Jul 2010)


Object.restrict_render -> hide_render

So change the 2 occurances in exporters !


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

Re: Look here for latest blender2.5-api adaptions !!

Postby dougal2 » Fri Jul 16, 2010 5:45 pm

User avatar
dougal2
Developer
 
Posts: 3131
Joined: Mon Jan 14, 2008 7:21 am

Re: Look here for latest blender2.5-api adaptions !!

Postby jensverwiebe » Sat Jul 17, 2010 9:54 am

Hey Doug, a general thing here:

Although not everyone was caught by this, Misto found due trouble that you used everywhere the coding clause:
# -*- coding: utf8 -*-

but afaik it should read ( and worked out for Misto ):
# -*- coding: utf-8 -*-

( see the " - " between utf and 8 )

Perhaps better to correct this .


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

Re: Look here for latest blender2.5-api adaptions !!

Postby aidanodr » Tue Jul 20, 2010 12:18 pm

Thanks to jensverwiebe,

"Object.restrict_render -> hide_render -- So change the 2 occurrences in exporters !"

EQUALS

"Sure...find all "restrict_render" in py´s and replace with "hide_render" in an editor."

From what I can see the PY file that needs changing is geometry.py in \scripts\io\luxrender\export ...

From what I can now gather -

the LUXRENDER and the EF folders need to be installed into that new 2.52 folder created in recent Blender Builds - to make all this work in the first place ..

Cheers and Thanks
Aidan
aidanodr
 
Posts: 23
Joined: Mon Feb 01, 2010 9:30 am

Re: Look here for latest blender2.5-api adaptions !!

Postby dougal2 » Tue Jul 20, 2010 12:25 pm

the restrict_ -> hide_ change is already in our code repository. Right now, you don't need to edit the code, just grab the latest using the ZIP link at the top of this page: http://src.luxrender.net/luxblend25/
User avatar
dougal2
Developer
 
Posts: 3131
Joined: Mon Jan 14, 2008 7:21 am

Re: Look here for latest blender2.5-api adaptions !!

Postby aidanodr » Tue Jul 20, 2010 12:55 pm

And so the game of Cat and Mouse continues :D

Just did a new build - svn 30548. ( 20-7-2010 )

Yet another new folder has appeared in the Blender 2.5 installation.

I mentioned previously that a folder called 2.52 appeared. The new one alongside this is 2.53.

As I mentioned before the LUXRENDER and the EF folders needed for Luxblend had to be installed inside that 2.52 folder - \2.52\scripts\io - instead of \.blender\scripts\io. Strike that - now install them inside the new 2.53 folder - \2.53\scripts\io.

All seems to work fine .... until the 2.54 folder arrives :D

This of course pre supposes the Windows Version of Blender 2.5 .. ( in my case )
Aidan
aidanodr
 
Posts: 23
Joined: Mon Feb 01, 2010 9:30 am

Re: Look here for latest blender2.5-api adaptions !!

Postby jensverwiebe » Tue Jul 20, 2010 1:39 pm

aidanodr wrote:And so the game of Cat and Mouse continues :D

Just did a new build - svn 30548. ( 20-7-2010 )

Yet another new folder has appeared in the Blender 2.5 installation.

I mentioned previously that a folder called 2.52 appeared. The new one alongside this is 2.53.

As I mentioned before the LUXRENDER and the EF folders needed for Luxblend had to be installed inside that 2.52 folder - \2.52\scripts\io - instead of \.blender\scripts\io. Strike that - now install them inside the new 2.53 folder - \2.53\scripts\io.

All seems to work fine .... until the 2.54 folder arrives :D

This of course pre supposes the Windows Version of Blender 2.5 .. ( in my case )
Aidan


But if you followed my long proposed precedure to have an Scriptsfolder externally and pointed to it in the blender-prefs/files/pathes, all would have been fine allso after consecutive
updates :P


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

Re: Look here for latest blender2.5-api adaptions !!

Postby aidanodr » Tue Jul 20, 2010 2:20 pm

You reckon Jens??

The way they are swapping around folders and changing stuff now would that work?

EDIT: mmm, yes that might :D

EDIT AGAIN: However with added folders like 2.52 with its own scripts folder AND now 2.53 folder with its own scripts folder I imagine one would still be copying out stuff to an outside script folder from these?

Aidan
aidanodr
 
Posts: 23
Joined: Mon Feb 01, 2010 9:30 am

Next

Return to LuxBlend (Blender Exporter)

Who is online

Users browsing this forum: Bing [Bot] and 2 guests