[LuxBlend25] Change in matrix indexing, testing needed

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

Moderators: Ratow, SATtva, coordinators

[LuxBlend25] Change in matrix indexing, testing needed

Postby Lord Crc » Thu Dec 22, 2011 5:42 pm

Hi,

as detailed on this page the indexing of matrices has changed in Blender r42816 to the standard "row, column" notation.

I've gone over the code and tried to find all the spots which are affected, however I may have missed some so this will require extensive testing.

Since this is a breaking change from Blender, I've tagged the previous changeset as "v09-2.61".
May contain traces of nuts.
User avatar
Lord Crc
Developer
 
Posts: 4454
Joined: Sat Nov 17, 2007 2:10 pm

Re: [LuxBlend25] Change in matrix indexing, testing needed

Postby jensverwiebe » Fri Dec 23, 2011 6:17 am

Hi Lord...

Looks good so far.

I did same for smallluxGPU, but added a versioncheck: ( if bpy.app.build_revision > '42815': )

Code: Select all
     1.1 --- a/samples/smallluxgpu2/blender/render_smallluxgpu.py   Tue Dec 20 07:16:34 2011 +0100
     1.2 +++ b/samples/smallluxgpu2/blender/render_smallluxgpu.py   Fri Dec 23 12:03:57 2011 +0100
     1.3 @@ -391,10 +391,16 @@
     1.4      def getobjscn(scene):
     1.5          scn = {}
     1.6          def objscn(plyn, matn, objn, mat, tm):
     1.7 -            if tm:
     1.8 -                scn['scene.objects.{}.{}.transformation'.format(matn,objn)] = '{} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}'.format(
     1.9 -                        ff(tm[0][0]),ff(tm[0][1]),ff(tm[0][2]),ff(tm[0][3]),ff(tm[1][0]),ff(tm[1][1]),ff(tm[1][2]),ff(tm[1][3]),
    1.10 -                        ff(tm[2][0]),ff(tm[2][1]),ff(tm[2][2]),ff(tm[2][3]),ff(tm[3][0]),ff(tm[3][1]),ff(tm[3][2]),ff(tm[3][3]))
    1.11 +            if tm:
    1.12 +                if bpy.app.build_revision > '42815':
    1.13 +                    scn['scene.objects.{}.{}.transformation'.format(matn,objn)] = '{} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}'.format(
    1.14 +                        ff(tm[0][0]),ff(tm[1][0]),ff(tm[2][0]),ff(tm[3][0]),ff(tm[0][1]),ff(tm[1][1]),ff(tm[2][1]),ff(tm[3][1]),
    1.15 +                        ff(tm[0][2]),ff(tm[1][2]),ff(tm[2][2]),ff(tm[3][2]),ff(tm[0][3]),ff(tm[1][3]),ff(tm[2][3]),ff(tm[3][3]))
    1.16 +                else:
    1.17 +                    scn['scene.objects.{}.{}.transformation'.format(matn,objn)] = '{} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}'.format(
    1.18 +                        ff(tm[0][0]),ff(tm[0][1]),ff(tm[0][2]),ff(tm[0][3]),ff(tm[1][0]),ff(tm[1][1]),ff(tm[1][2]),ff(tm[1][3]),
    1.19 +                        ff(tm[2][0]),ff(tm[2][1]),ff(tm[2][2]),ff(tm[2][3]),ff(tm[3][0]),ff(tm[3][1]),ff(tm[3][2]),ff(tm[3][3]))
    1.20 +
    1.21              if not SLGBP.live:
    1.22                  scn['scene.objects.{}.{}'.format(matn,objn)] = '{}/{}/{}.ply'.format(SLGBP.spath,SLGBP.sname,plyn)
    1.23                  if scene.slg.vnormals:


Perhaps we can do same in luxblend, but then again it is much more places to handle.

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

Re: [LuxBlend25] Change in matrix indexing, testing needed

Postby Lord Crc » Wed Feb 01, 2012 8:40 am

I've added some code to make luxblend25 backwards compatible, it should now run on 2.61 official and later builds.
May contain traces of nuts.
User avatar
Lord Crc
Developer
 
Posts: 4454
Joined: Sat Nov 17, 2007 2:10 pm


Return to LuxBlend (Blender Exporter)

Who is online

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