rpms/LuxRender/devel LuxBlend_0.6.1.py, NONE, 1.1 lux-0.6.1-shared.patch, NONE, 1.1 .cvsignore, 1.2, 1.3 LuxRender.spec, 1.3, 1.4 import.log, 1.1, 1.2 sources, 1.2, 1.3 LuxRender_v05-shared.patch, 1.1, NONE lux-0.5-intrinsic.patch, 1.1, NONE

Nicolas Chauvet kwizart at fedoraproject.org
Sun Feb 14 18:03:39 UTC 2010


Author: kwizart

Update of /cvs/pkgs/rpms/LuxRender/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv21337/devel

Modified Files:
	.cvsignore LuxRender.spec import.log sources 
Added Files:
	LuxBlend_0.6.1.py lux-0.6.1-shared.patch 
Removed Files:
	LuxRender_v05-shared.patch lux-0.5-intrinsic.patch 
Log Message:
Update to 0.6.1



--- NEW FILE LuxBlend_0.6.1.py ---
#!BPY
# -*- coding: utf-8 -*-
# coding=utf-8
"""Registration info for Blender menus:
Name: 'LuxBlend v0.6.1 Exporter'
Blender: 248
Group: 'Render'
Tooltip: 'Export/Render to LuxRender v0.6.1 scene format (.lxs)'
"""

__author__ = "radiance, zuegs, ideasman42, luxblender, dougal2"
__version__ = "0.6.1"
__url__ = [
	"http://www.luxrender.net/",
	"http://www.luxrender.net/forum/viewforum.php?f=11",
	"http://www.luxrender.net/wiki/index.php/Tutorial_1:_Your_first_scene_%26_render"
]
__bpydoc__ = """\
LuxRender is an open-source rendering system for physically correct, unbiased image synthesis.
This is the Luxrender Blender Export Script.

Useful links:
- For updates: http://www.luxrender.net/forum/viewforum.php?f=11
- For Blender Tutorial: http://www.luxrender.net/wiki/index.php/Tutorial_1:_Your_first_scene_%26_render

Usage: 
- Run the script from the render menu.
- Set the default location of the Luxrender.exe.

Please check the lux tutorials & forums for more information.
"""

#
# ***** BEGIN GPL LICENSE BLOCK *****
#
# --------------------------------------------------------------------------
# LuxBlend v0.6.1 exporter
# --------------------------------------------------------------------------
#
# Authors:
# radiance, zuegs, ideasman42, luxblender, dougal2
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
#
# ***** END GPL LICENCE BLOCK *****
# --------------------------------------------------------------------------




######################################################
# Importing modules
######################################################

import math
import time
import os
import sys as osys
import types
import subprocess
import Blender
from Blender import Mesh, Scene, Object, Material, Texture, Window, sys, Draw, BGL, Mathutils, Lamp, Image




######################################################
# Functions
######################################################

# New name based on old with a different extension
def newFName(ext):
    return Blender.Get('filename')[: -len(Blender.Get('filename').split('.', -1)[-1]) ] + ext


# some helpers
def luxstr(str):
    return str.replace("\\", "\\\\")


### relpath ##########################
def relpath(base, target):
    if target[0:2] == "\\\\" or target[0:2] == "//":
        return target[2:len(target)]
    if not os.path.isabs(base):
        base = os.path.abspath(base)
    if not os.path.isabs(target):
        target = os.path.abspath(target)
    if os.sep == "\\":
        base = os.path.normcase(base)
        target = os.path.normcase(target)
    if base == os.sep:
        return '.' + target
    baselist = base.split(os.sep)
    if baselist[-1] == "":
        baselist = baselist[:-1]
    targetlist = target.split(os.sep)
    i = 0
    top = min([len(baselist), len(targetlist)])
    while i < top and baselist[i] == targetlist[i]:
        i+=1
    if i == 0:
        return os.sep.join(targetlist)
    if i == len(baselist):
        return os.sep.join(targetlist[i:])
    else:
        return ('..' + os.sep) * (len(baselist) - i) + os.sep.join(targetlist[i:])

### luxFilePath #####################
lxs_filename = ""
previewing = False
def luxFilePath(filename):
    global lxs_filename, previewing
    scn = Scene.GetCurrent()
    pm = luxProp(scn, "pathmode", "absolute").get()
    if (pm=="absolute") or previewing: # absolute paths (the old / default mode)
        return filename
    elif pm=="relative": # relative paths
        base = os.path.dirname(lxs_filename)
        return relpath(base, filename)
    elif pm=="flat": # flat mode - only filename
        return os.path.basename(filename)



###### RGC ##########################
def rg(col):
    scn = Scene.GetCurrent()
    if luxProp(scn, "RGC", "true").get()=="true":
        gamma = luxProp(scn, "film.gamma", 2.2).get()
    else:
        gamma = 1.0
    ncol = col**gamma
    if luxProp(scn, "colorclamp", "false").get()=="true":
        ncol = ncol * 0.9
        if ncol > 0.9:
            ncol = 0.9
        if ncol < 0.0:
            ncol = 0.0
    return ncol

def texturegamma():
    scn = Scene.GetCurrent()
    if luxProp(scn, "RGC", "true").get()=="true":
        return luxProp(scn, "film.gamma", 2.2).get()
    else:
        return 1.0

def exportMaterial(mat):
    str = "# Material '%s'\n" %mat.name
    return str+luxMaterial(mat)+"\n"


def exportMaterialGeomTag(mat):
    return "%s\n"%(luxProp(mat, "link", "").get())




################################################################


dummyMat = 2394723948 # random identifier for dummy material
clayMat = None

#-------------------------------------------------
# getMaterials(obj)
# helper function to get the material list of an object in respect of obj.colbits
#-------------------------------------------------
def getMaterials(obj, compress=False):
    global clayMat
    mats = [None]*16
    colbits = obj.colbits
    objMats = obj.getMaterials(1)
    data = obj.getData(mesh=1)
    try:
        dataMats = data.materials
    except:
        try:
            dataMats = data.getMaterials(1)
        except:
            dataMats = []
            colbits = 0xffff
    m = max(len(objMats), len(dataMats))
    if m>0:
        objMats.extend([None]*16)
        dataMats.extend([None]*16)
[...6326 lines suppressed...]
                saveScenePreset(name, usedproperties.copy())
                luxProp(scn, "preset", "").set(name)
                Draw.Redraw()
    if evt == evtDeletePreset:
        presets = getScenePresets().keys()
        presets.sort()
        presetsstr = "delete preset: %t"
        for i, v in enumerate(presets): presetsstr += "|%s %%x%d"%(v, i)
        r = Draw.PupMenu(presetsstr, 20)
        if r >= 0:
            saveScenePreset(presets[r], None)
            Draw.Redraw()

    if evt == evtLoadMaterial:
        if activemat:
            mats = getMaterialPresets()
            matskeys = mats.keys()
            matskeys.sort()
            matsstr = "load preset: %t"
            for i, v in enumerate(matskeys): matsstr += "|%s %%x%d"%(v, i)
            r = Draw.PupMenu(matsstr, 20)
            if r >= 0:
                name = matskeys[r]
                try:
#                    for k,v in mats[name].items(): activemat.properties['luxblend'][k] = v
                    for k,v in mats[name].items(): luxProp(activemat, k, None).set(v)
                except: pass
                Draw.Redraw()
    if evt == evtSaveMaterial:
        if activemat:
            name = Draw.PupStrInput("preset name: ", "")
            if name != "":
                usedproperties = {}
                usedpropertiesfilterobj = activemat
                luxMaterial(activemat)
                saveMaterialPreset(name, usedproperties.copy())
                Draw.Redraw()
    if evt == evtDeleteMaterial:
        matskeys = getMaterialPresets().keys()
        matskeys.sort()
        matsstr = "delete preset: %t"
        for i, v in enumerate(matskeys): matsstr += "|%s %%x%d"%(v, i)
        r = Draw.PupMenu(matsstr, 20)
        if r >= 0:
            saveMaterialPreset(matskeys[r], None)
            Draw.Redraw()
    if evt == evtConvertMaterial:
        if activemat: convertMaterial(activemat)
        Draw.Redraw()
    if evt == evtLoadMaterial2:
        if activemat:
            scn = Scene.GetCurrent()
            Window.FileSelector(lambda fn:loadMatTex(activemat, fn), "load material", luxProp(scn, "lux", "").get()+os.sep+".lbm")
    if evt == evtSaveMaterial2:
        if activemat:
            scn = Scene.GetCurrent()
            Window.FileSelector(lambda fn:saveMaterial(activemat, fn), "save material", luxProp(scn, "lux", "").get()+os.sep+".lbm")
    

def setFocus(target):
    currentscene = Scene.GetCurrent()
    camObj = currentscene.objects.camera # currentscene.getCurrentCamera()
    if target == "S":
        try:
            refLoc = (Object.GetSelected()[0]).getLocation()
        except:
            print("select an object to focus\n")
    elif target == "C":
        refLoc = Window.GetCursorPos()
    else:
        refLoc = (Object.Get(target)).getLocation()
    dist = Mathutils.Vector(refLoc) - Mathutils.Vector(camObj.getLocation())
    camDir = camObj.getMatrix()[2]*(-1.0)
    camObj.getData(mesh=1).dofDist = (camDir[0]*dist[0]+camDir[1]*dist[1]+camDir[2]*dist[2])/camDir.length # data


# Parse command line arguments for batch mode rendering if supplied

try:
    batchindex = osys.argv.index('--batch')
    pyargs = osys.argv[osys.argv.index('--batch')+1:]
except: pyargs = []

if (pyargs != []) and (batchindex != 0):
    print("\n\nLuxBlend v%s - BATCH mode\n"%__version__)
    LuxIsGUI = False

    scene = Scene.GetCurrent()
    context = scene.getRenderingContext()

    luxpath = ""
    import getopt
    o, a = getopt.getopt(pyargs, 's:e:o:t:l:',["scale=","haltspp=","run=", "lbm=", "lbt="])

    opts = {}
    for k,v in o:
        opts[k] = v

    if (opts.has_key('--run')) and (opts['--run'] == 'false'):
        print("Run: false")
        luxProp(scene, "run", "true").set("false")
    else:
        luxProp(scene, "run", "true").set("true")

    if opts.has_key('--scale'):
        print("Zoom: %s" %opts['--scale'])
        luxProp(scene, "film.scale", "100 %").set(opts['--scale'])

    if opts.has_key('--haltspp'):
        print("haltspp: %s" %opts['--haltspp'])
        luxProp(scene, "haltspp", 0).set(int(opts['--haltspp']))

    if opts.has_key('-s'):
        print("Start frame: %s" %opts['-s'])
        context.startFrame(int(opts['-s']))
    else:
        print("Error: Start frame not supplied (-s)"); osys.exit(1)
    if opts.has_key('-e'):
        print("End frame: %s" %opts['-e'])
        context.endFrame(int(opts['-e']))
    else:
        print("Error: End frame not supplied (-e)"); osys.exit(1)
    if opts.has_key('-l'):
        print("Path to lux binary: %s" %opts['-l'])
        luxbatchconsolemode = luxProp(scene, "luxbatchc", "false")
        luxbatchconsolemode.set("true")
        luxpathprop = luxProp(scene, "lux", "")
        luxpathprop.set(opts['-l'])
    else:
        print("Error: path to lux binary not supplied (-l)"); osys.exit(1)
    if opts.has_key('-o'):
        print("Image output path: %s" %opts['-o'])
        luxProp(scene, "overrideoutputpath", "").set(opts['-o'])
    else:
        print("Error: image output path not supplied (-o)"); osys.exit(1)
    if opts.has_key('-t'):
        print("Temporary export path: %s" %opts['-t'])
        luxProp(scene, "datadir", "").set(opts['-t'])
    else:
        print("Error: Temporary export path not supplied (-t)"); osys.exit(1)
    
    if opts.has_key('--lbm'):
        print("Load material: %s" %opts['--lbm'])
        mat = Material.Get("Material")
        if mat: loadMatTex(mat, opts['--lbm'])
        else:
            print("Error: No material with name \"Material\" found (--lbm)"); osys.exit(1)
            
    if opts.has_key('--lbt'):
        print("Load material: %s" %opts['--lbt'])
        mat = Material.Get("Material")
        if mat: loadMatTex(mat, opts['--lbt'], ':Kd')
        else:
            print("Error: No material with name \"Material\" found (--lbt)"); osys.exit(1)

#    CBluxAnimExport(True, True)
    CBluxAnimExport(True, True, False) # as by zukazuka (http://www.luxrender.net/forum/viewtopic.php?f=11&t=1288)
    osys.exit(0)

else:
    print("\n\nLuxBlend v%s - UI mode\n"%__version__)
    from Blender.Window import DrawProgressBar
    LuxIsGUI = True
    
    Draw.Register(luxDraw, luxEvent, luxButtonEvt) # init GUI

    luxpathprop = luxProp(Scene.GetCurrent(), "lux", "")
    luxpath = luxpathprop.get()
    luxrun = luxProp(Scene.GetCurrent(), "run", True).get()
    checkluxpath = luxProp(Scene.GetCurrent(), "checkluxpath", True).get()

    if checkluxpath and luxrun:
        if (luxpath is None) or (sys.exists(luxpath)<=0):
            # luxpath not valid, so delete entry from .blend scene file
            luxpathprop.delete()
            # and re-get luxpath, so we get the path from default-settings
            luxpath = luxpathprop.get()
            #
            LUXRENDER_ROOT = os.getenv('LUXRENDER_ROOT')
            if LUXRENDER_ROOT is not None:
                LUXRENDER_ROOT = LUXRENDER_ROOT + os.sep
                luxpathprop.set(LUXRENDER_ROOT)
                luxpath = LUXRENDER_ROOT
                if sys.exists(luxpath)>0:
                    print('LuxRender path set from LUXRENDER_ROOT environment variable')
                    saveluxdefaults()
            
            if (luxpath is None) or (sys.exists(luxpath)<=0):
                print("WARNING: LuxPath \"%s\" is not valid\n"%(luxpath))
                scn = Scene.GetCurrent()
                if scn:
                    r = Draw.PupMenu("Installation: Set path to the lux render software?%t|Yes%x1|No%x0|Never%x2")
                    if r == 1:
                        Window.FileSelector(lambda s:luxProp(scn, "lux", "").set(Blender.sys.dirname(s)+os.sep), "Select file in Lux path")
                        saveluxdefaults()
                    if r == 2:
                        newluxdefaults["checkluxpath"] = False
                        saveluxdefaults()
    else    :
        print("Lux path check disabled\n")

lux-0.6.1-shared.patch:
 CMakeLists.txt |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- NEW FILE lux-0.6.1-shared.patch ---
diff -up lux-0.6.1/CMakeLists.txt.shared lux-0.6.1/CMakeLists.txt
--- lux-0.6.1/CMakeLists.txt.shared	2010-02-14 17:37:32.057828869 +0100
+++ lux-0.6.1/CMakeLists.txt	2010-02-14 17:38:03.606830043 +0100
@@ -662,8 +662,9 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/
 LINK_DIRECTORIES(${LINK_DIRECTORIES} ${Boost_LIBRARY_DIRS} ${OPENEXR_LIB_DIRS} ${PNG_LIBRARY} ${TIFF_LIBRARY} ${JPEG_LIBRARY})
 
 #Here we build the core library
-ADD_LIBRARY(lux STATIC ${lux_lib_src} )
+ADD_LIBRARY(lux SHARED ${lux_lib_src} )
 #TARGET_LINK_LIBRARIES(lux ${OPENEXR_LIBRARIES} ${Boost_LIBRARIES} ${PNG_LIBRARIES} ${TIFF_LIBRARIES} ${JPEG_LIBRARIES} )
+SET_TARGET_PROPERTIES(lux PROPERTIES SOVERSION 1 VERSION "1.0")
 
 
 #############################################################################


Index: .cvsignore
===================================================================
RCS file: /cvs/pkgs/rpms/LuxRender/devel/.cvsignore,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -p -r1.2 -r1.3
--- .cvsignore	18 May 2009 10:49:20 -0000	1.2
+++ .cvsignore	14 Feb 2010 18:03:38 -0000	1.3
@@ -1,2 +1 @@
-LuxBlend_v05_Blender_Exporter.zip
-LuxRender_v05_Source.zip
+lux-0.6.1.tar.bz2


Index: LuxRender.spec
===================================================================
RCS file: /cvs/pkgs/rpms/LuxRender/devel/LuxRender.spec,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -p -r1.3 -r1.4
--- LuxRender.spec	21 Jan 2010 18:59:44 -0000	1.3
+++ LuxRender.spec	14 Feb 2010 18:03:38 -0000	1.4
@@ -1,16 +1,18 @@
 Name:           LuxRender
-Version:        0.5
-Release:        6%{?dist}
+Version:        0.6.1
+Release:        1%{?dist}
 Summary:        Lux Renderer, an unbiased rendering system
 
 Group:          Applications/Multimedia
 License:        GPLv3+ and BSD
 URL:            http://www.luxrender.net
-Source0:        http://www.luxrender.net/downloads/v05_release/LuxRender_v05_Source.zip
-Source1:        http://www.luxrender.net/downloads/v05_release/LuxBlend_v05_Blender_Exporter.zip
+#Source0:        http://www.luxrender.net/downloads/v05_release/LuxRender_v05_Source.zip
+#Taken from http://src.luxrender.net/lux/archive/36533b0843bd.tar.bz2 AKA 6.1 release
+Source0:        lux-%{version}.tar.bz2
+#http://src.luxrender.net/luxblend/raw-file/4b8109987265/LuxBlend_0.1.py
+Source1:        LuxBlend_%{version}.py
 Source2:        luxblend-default.cfg
-Patch0:         LuxRender_v05-shared.patch
-Patch1:         lux-0.5-intrinsic.patch
+Patch0:         lux-0.6.1-shared.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 BuildRequires:  desktop-file-utils
@@ -79,26 +81,12 @@ applications with %{name}.
 
 
 %prep
-%setup -q -n lux
-%setup -q -D -T -a 1 -n lux
+%setup -q -n lux-%{version}
 %patch0 -p1 -b .shared
-%patch1 -p1 -b .intrinsic
-install -pm 0644 core/SFMT/LICENSE.txt LICENSE-SFMT.txt
 #Disable tweaking
 sed -i -e 's/-O3 -msse2 -mfpmath=sse -ftree-vectorize -funroll-loops -Wall//' CMakeLists.txt
 
 
-for f in AUTHORS.txt COPYING.txt LICENSE-SFMT.txt ; do
-  cp -p ${f} ${f}.ref
-  sed -i 's/\r//' ${f}
-  touch -r ${f}.ref ${f}
-  rm ${f}.ref
-done
-
-#Disable wrong-end-of-line-encoding
-sed -i 's|\r||' LuxBlend_0.1.py
-
-
 %build
 mkdir -p build
 pushd build
@@ -134,15 +122,18 @@ desktop-file-install --vendor "" --delet
   --remove-category Application \
   $RPM_BUILD_ROOT%{_datadir}/applications/luxrender.desktop
 
-install -pm 0755 build/wxluxgui $RPM_BUILD_ROOT%{_bindir}
 
 mkdir -p $RPM_BUILD_ROOT%{_datadir}/blender/scripts/bpydata/config
-install -pm 0644 LuxBlend_0.1.py $RPM_BUILD_ROOT%{_datadir}/blender/scripts/
+
+install -pm 0644 %{SOURCE1} \
+  $RPM_BUILD_ROOT%{_datadir}/blender/scripts/LuxBlend_%{version}.py
+
 
 install -pm 0644 %{SOURCE2} \
   $RPM_BUILD_ROOT%{_datadir}/blender/scripts/bpydata/config/luxblend.cfg
 
 
+
 %clean
 rm -rf $RPM_BUILD_ROOT
 
@@ -154,8 +145,8 @@ rm -rf $RPM_BUILD_ROOT
 
 %files
 %defattr(-,root,root,-)
-%doc AUTHORS.txt COPYING.txt LICENSE-SFMT.txt
-%{_bindir}/wxluxgui
+%doc AUTHORS.txt COPYING.txt
+#{_bindir}/wxluxgui
 %{_bindir}/luxrender
 %{_datadir}/pixmaps/luxrender.svg
 %{_datadir}/applications/luxrender.desktop
@@ -167,10 +158,11 @@ rm -rf $RPM_BUILD_ROOT
 %files core
 %defattr(-,root,root,-)
 %{_bindir}/luxconsole
+%{_bindir}/luxmerger
 
 %files blender
 %defattr(-,root,root,-)
-%{_datadir}/blender/scripts/LuxBlend_0.1.py*
+%{_datadir}/blender/scripts/LuxBlend_%{version}.py*
 %{_datadir}/blender/scripts/bpydata/config/luxblend.cfg
 
 %files devel


Index: import.log
===================================================================
RCS file: /cvs/pkgs/rpms/LuxRender/devel/import.log,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- import.log	18 May 2009 10:49:21 -0000	1.1
+++ import.log	14 Feb 2010 18:03:39 -0000	1.2
@@ -1 +1,2 @@
 LuxRender-0_5-4_fc10:HEAD:LuxRender-0.5-4.fc10.src.rpm:1242643566
+LuxRender-0_6_1-1_fc12:HEAD:LuxRender-0.6.1-1.fc12.src.rpm:1266170387


Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/LuxRender/devel/sources,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -p -r1.2 -r1.3
--- sources	18 May 2009 10:49:21 -0000	1.2
+++ sources	14 Feb 2010 18:03:39 -0000	1.3
@@ -1,2 +1 @@
-7cb0920c7c77ebaa5d7a721be124a27f  LuxBlend_v05_Blender_Exporter.zip
-c02174b85917b68ac5f681a4f117b7bd  LuxRender_v05_Source.zip
+a3531215f1c46027491e6072d9a7c4af  lux-0.6.1.tar.bz2


--- LuxRender_v05-shared.patch DELETED ---


--- lux-0.5-intrinsic.patch DELETED ---



More information about the scm-commits mailing list