tabs to spaces, remove trailing white space. (apart of pep8)
authorCampbell Barton <ideasman42@gmail.com>
Sat, 31 Oct 2009 19:31:45 +0000 (19:31 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 31 Oct 2009 19:31:45 +0000 (19:31 +0000)
didnt do "release/scripts/io" since some exporters cant be auto converted

52 files changed:
release/datafiles/datatoc.py
release/scripts/modules/bpy_ext/Object.py
release/scripts/modules/bpy_ops.py
release/scripts/modules/bpy_sys.py
release/scripts/modules/dynamic_menu.py
release/scripts/templates/gamelogic.py
release/scripts/templates/gamelogic_basic.py
release/scripts/templates/gamelogic_module.py
release/scripts/templates/operator.py
release/scripts/templates/operator_simple.py
release/scripts/ui/buttons_data_armature.py
release/scripts/ui/buttons_data_bone.py
release/scripts/ui/buttons_data_camera.py
release/scripts/ui/buttons_data_curve.py
release/scripts/ui/buttons_data_empty.py
release/scripts/ui/buttons_data_lamp.py
release/scripts/ui/buttons_data_lattice.py
release/scripts/ui/buttons_data_mesh.py
release/scripts/ui/buttons_data_metaball.py
release/scripts/ui/buttons_data_modifier.py
release/scripts/ui/buttons_data_text.py
release/scripts/ui/buttons_game.py
release/scripts/ui/buttons_material.py
release/scripts/ui/buttons_object.py
release/scripts/ui/buttons_object_constraint.py
release/scripts/ui/buttons_particle.py
release/scripts/ui/buttons_physics_cloth.py
release/scripts/ui/buttons_physics_common.py
release/scripts/ui/buttons_physics_field.py
release/scripts/ui/buttons_physics_fluid.py
release/scripts/ui/buttons_physics_smoke.py
release/scripts/ui/buttons_physics_softbody.py
release/scripts/ui/buttons_render.py
release/scripts/ui/buttons_scene.py
release/scripts/ui/buttons_texture.py
release/scripts/ui/buttons_world.py
release/scripts/ui/space_buttons.py
release/scripts/ui/space_filebrowser.py
release/scripts/ui/space_image.py
release/scripts/ui/space_info.py
release/scripts/ui/space_logic.py
release/scripts/ui/space_node.py
release/scripts/ui/space_outliner.py
release/scripts/ui/space_sequencer.py
release/scripts/ui/space_text.py
release/scripts/ui/space_time.py
release/scripts/ui/space_userpref.py
release/scripts/ui/space_view3d.py
release/scripts/ui/space_view3d_toolbar.py
source/blender/python/epy_doc_gen.py
source/blender/python/rna_dump.py
source/blender/python/simple_enum_gen.py

index 362d4ddc126db91953a3e04e158aa9898d57041e..70bb348ad02efe4c61a1216593a1e3f5fabecbd5 100755 (executable)
 import sys, os
 
 if len(sys.argv) < 2:
-       sys.stdout.write("Usage: datatoc <data_file>\n")
-       sys.exit(1)
+    sys.stdout.write("Usage: datatoc <data_file>\n")
+    sys.exit(1)
 
 filename = sys.argv[1]
 
 try:
-       fpin = open(filename, "rb");
+    fpin = open(filename, "rb");
 except:
-       sys.stdout.write("Unable to open input %s\n" % sys.argv[1])
-       sys.exit(1)
+    sys.stdout.write("Unable to open input %s\n" % sys.argv[1])
+    sys.exit(1)
 
 fpin.seek(0, os.SEEK_END)
 size = fpin.tell()
 fpin.seek(0)
 
 if filename[0] == ".":
-       filename = filename[1:]
+    filename = filename[1:]
 
 cname = filename + ".c"
 sys.stdout.write("Making C file <%s>\n" % cname)
@@ -52,10 +52,10 @@ filename = filename.replace(".", "_")
 sys.stdout.write(str(size))
 sys.stdout.write("\n")
 try:
-       fpout = open(cname, "w")
+    fpout = open(cname, "w")
 except:
-       sys.stdout.write("Unable to open output %s\n" % cname)
-       sys.exit(1)
+    sys.stdout.write("Unable to open output %s\n" % cname)
+    sys.exit(1)
 
 fpout.write("/* DataToC output of file <%s> */\n\n" % filename)
 fpout.write("int datatoc_%s_size= %d;\n" % (filename, size))
@@ -63,11 +63,11 @@ fpout.write("int datatoc_%s_size= %d;\n" % (filename, size))
 fpout.write("char datatoc_%s[]= {\n" % filename)
 
 while size > 0:
-       size -= 1
-       if size % 32 == 31:
-               fpout.write("\n")
-       
-       fpout.write("%3d," % ord(fpin.read(1)))
+    size -= 1
+    if size % 32 == 31:
+        fpout.write("\n")
+
+    fpout.write("%3d," % ord(fpin.read(1)))
 
 fpout.write("\n  0};\n\n")
 
index a842318844e07e8e926bc4761d6c726887953c66..6419e1f1017297e1ca31877bbd1d1b5fe0ef280d 100644 (file)
@@ -1,4 +1,4 @@
 import bpy
 class_obj = bpy.types.Object
 
-class_obj.getChildren = lambda ob: [child for child in bpy.data.objects if child.parent == ob]
\ No newline at end of file
+class_obj.getChildren = lambda ob: [child for child in bpy.data.objects if child.parent == ob]
index 1f6d6bf8526aa8a875fb48ea5135534a39003af0..ce6e85da4e763db27ebb82af2252d91995cb17b7 100644 (file)
@@ -220,11 +220,11 @@ class WM_OT_context_set_boolean(bpy.types.Operator):
     '''Set a context value.'''
     bl_idname = "wm.context_set_boolean"
     bl_label = "Context Set"
-    
+
     path = rna_path_prop
     value = BoolProperty(name="Value",
             description="Assignment value", default=True)
-    
+
     execute = execute_context_assign
 
 
@@ -232,10 +232,10 @@ class WM_OT_context_set_int(bpy.types.Operator): # same as enum
     '''Set a context value.'''
     bl_idname = "wm.context_set_int"
     bl_label = "Context Set"
-    
+
     path = rna_path_prop
     value = IntProperty(name="Value", description="Assign value", default=0)
-    
+
     execute = execute_context_assign
 
 
@@ -255,7 +255,7 @@ class WM_OT_context_set_string(bpy.types.Operator): # same as enum
     '''Set a context value.'''
     bl_idname = "wm.context_set_string"
     bl_label = "Context Set"
-    
+
     path = rna_path_prop
     value = StringProperty(name="Value",
             description="Assign value", maxlen=1024, default="")
index e60e8b01d09100fa46124bac0da64da24ebc32aa..a56d2dc62f17a57c52df25615ddc19db5cc6be2a 100644 (file)
@@ -2,10 +2,10 @@ import bpy
 import os
 
 def expandpath(path):
-       if path.startswith("//"):
-               return os.path.join(os.path.dirname(bpy.data.filename), path[2:])
-       
-       return path
+    if path.startswith("//"):
+        return os.path.join(os.path.dirname(bpy.data.filename), path[2:])
+
+    return path
 
 import types
 bpy.sys = types.ModuleType("bpy.sys")
index ce51dc9937b68946306c54d6b7ccaf09607a4eab..664271ab33f8b122a2cf157302ceacbd5ee08ecb 100644 (file)
@@ -1,86 +1,86 @@
 import bpy
 
 def collect_baseclasses(_class, bases):
-       
-       if _class is type or _class is object:
-               return bases
-       
-       bases.append(_class)
-       for _superclass in _class.__bases__:
-               collect_baseclasses(_superclass, bases)
-       
-       return bases
+
+    if _class is type or _class is object:
+        return bases
+
+    bases.append(_class)
+    for _superclass in _class.__bases__:
+        collect_baseclasses(_superclass, bases)
+
+    return bases
 
 def collect_subclasses(_class, subs):
-       
-       if _class is type or _class is object:
-               return subs
-       
-       subs.append(_class)
-       for _subclass in _class.__subclasses__():
-               collect_subclasses(_subclass, subs)
-       
-       return subs
+
+    if _class is type or _class is object:
+        return subs
+
+    subs.append(_class)
+    for _subclass in _class.__subclasses__():
+        collect_subclasses(_subclass, subs)
+
+    return subs
 
 class DynMenu(bpy.types.Menu):
-       
-       def draw(self, context):
-               '''
-               This is a draw function that is used to call all subclasses draw functions
-               starting from the registered classes draw function and working down.
-               
-               DynMenu.setup() must be called first.
-               
-               Sort/group classes could be nice
-               '''
-               
-               subclass_ls = []
-               collect_subclasses(self.__class__, subclass_ls)
-               # print(subclass_ls)
-               
-               for subclass in subclass_ls:
-                       # print("drawwing", subclass) # , dir(subclass))
-                       subclass.internal_draw(self, context)
-                       # print("subclass.internal_draw", subclass.internal_draw)
+
+    def draw(self, context):
+        '''
+        This is a draw function that is used to call all subclasses draw functions
+        starting from the registered classes draw function and working down.
+
+        DynMenu.setup() must be called first.
+
+        Sort/group classes could be nice
+        '''
+
+        subclass_ls = []
+        collect_subclasses(self.__class__, subclass_ls)
+        # print(subclass_ls)
+
+        for subclass in subclass_ls:
+            # print("drawwing", subclass) # , dir(subclass))
+            subclass.internal_draw(self, context)
+            # print("subclass.internal_draw", subclass.internal_draw)
 
 def setup(menu_class):
-       '''
-       Setup subclasses (not needed when self.add() is used)
-       '''
-       bases = collect_baseclasses(menu_class, [])
-       
-       # Incase 'DynMenu' isnt last
-       while bases[-1] is not DynMenu:
-               bases.pop()
-       bases.pop() # remove 'DynMenu'
-       
-       root_class = bases[-1] # this is the registered class
-       
-       for subclass in collect_subclasses(root_class, []):
-               #print(subclass)
-               
-               draw = getattr(subclass, 'draw', None)
-               if draw and not hasattr(subclass, 'internal_draw'):
-                       # print("replace", subclass, draw)
-                       try:
-                               del subclass.draw
-                       except:
-                               pass
-                       subclass.internal_draw = draw
-                       
-       root_class.draw = DynMenu.draw
+    '''
+    Setup subclasses (not needed when self.add() is used)
+    '''
+    bases = collect_baseclasses(menu_class, [])
+
+    # Incase 'DynMenu' isnt last
+    while bases[-1] is not DynMenu:
+        bases.pop()
+    bases.pop() # remove 'DynMenu'
+
+    root_class = bases[-1] # this is the registered class
+
+    for subclass in collect_subclasses(root_class, []):
+        #print(subclass)
+
+        draw = getattr(subclass, 'draw', None)
+        if draw and not hasattr(subclass, 'internal_draw'):
+            # print("replace", subclass, draw)
+            try:
+                del subclass.draw
+            except:
+                pass
+            subclass.internal_draw = draw
+
+    root_class.draw = DynMenu.draw
 
 def add(menu_class, func):
-       '''
-       Add a single function directly without having to make a class
-       
-       important that the returned value should be stored in the module that called it.
-       '''
-       
-       newclass = type('<menuclass>', (menu_class,), {})
-       newclass.internal_draw = func
-       setup(menu_class)
-       return newclass
+    '''
+    Add a single function directly without having to make a class
+
+    important that the returned value should be stored in the module that called it.
+    '''
+
+    newclass = type('<menuclass>', (menu_class,), {})
+    newclass.internal_draw = func
+    setup(menu_class)
+    return newclass
 
 '''
 # so we dont need to import this module
index af9dbd8a56aeb6f30ce76777d12fd3f8b7031a8a..8bfe799bacf304866fe447878d9ad0bba4105112 100644 (file)
@@ -4,75 +4,75 @@
 # GameLogic has been added to the global namespace no need to import
 
 # for keyboard event comparison
-# import GameKeys 
+# import GameKeys
 
 # support for Vector(), Matrix() types and advanced functions like AngleBetweenVecs(v1,v2) and RotationMatrix(...)
-# import Mathutils 
+# import Mathutils
 
 # for functions like getWindowWidth(), getWindowHeight()
 # import Rasterizer
 
 def main():
-       cont = GameLogic.getCurrentController()
-       
-       # The KX_GameObject that owns this controller.
-       own = cont.owner
-       
-       # for scripts that deal with spacial logic
-       own_pos = own.worldPosition
-       
-       
-       # Some example functions, remove to write your own script.
-       # check for a positive sensor, will run on any object without errors.
-       print 'Logic info for KX_GameObject', own.name
-       input = False
-       
-       for sens in cont.sensors:
-               # The sensor can be on another object, we may want to use it
-               own_sens = sens.owner
-               print '    sensor:', sens.name,
-               if sens.positive:
-                       print '(true)'
-                       input = True
-               else:
-                       print '(false)'
-       
-       for actu in cont.actuators:
-               # The actuator can be on another object, we may want to use it
-               own_actu = actu.owner
-               print '    actuator:', actu.name
-               
-               # This runs the actuator or turns it off
-               # note that actuators will continue to run unless explicitly turned off.
-               if input:
-                       cont.activate(actu)
-               else:
-                       cont.deactivate(actu)
-       
-       # Its also good practice to get sensors and actuators by name
-       # rather then index so any changes to their order wont break the script.
-       
-       # sens_key = cont.sensors['key_sensor']
-       # actu_motion = cont.actuators['motion']
-       
-       
-       # Loop through all other objects in the scene
-       sce = GameLogic.getCurrentScene()
-       print 'Scene Objects:', sce.name
-       for ob in sce.objects:
-               print '   ', ob.name, ob.worldPosition
-       
-       
-       # Example where collision objects are checked for their properties
-       # adding to our objects "life" property
-       """
-       actu_collide = cont.sensors['collision_sens']
-       for ob in actu_collide.objectHitList:
-               # Check to see the object has this property
-               if ob.has_key('life'):
-                       own['life'] += ob['life']
-                       ob['life'] = 0
-       print own['life']
-       """
+    cont = GameLogic.getCurrentController()
+
+    # The KX_GameObject that owns this controller.
+    own = cont.owner
+
+    # for scripts that deal with spacial logic
+    own_pos = own.worldPosition
+
+
+    # Some example functions, remove to write your own script.
+    # check for a positive sensor, will run on any object without errors.
+    print 'Logic info for KX_GameObject', own.name
+    input = False
+
+    for sens in cont.sensors:
+        # The sensor can be on another object, we may want to use it
+        own_sens = sens.owner
+        print '    sensor:', sens.name,
+        if sens.positive:
+            print '(true)'
+            input = True
+        else:
+            print '(false)'
+
+    for actu in cont.actuators:
+        # The actuator can be on another object, we may want to use it
+        own_actu = actu.owner
+        print '    actuator:', actu.name
+
+        # This runs the actuator or turns it off
+        # note that actuators will continue to run unless explicitly turned off.
+        if input:
+            cont.activate(actu)
+        else:
+            cont.deactivate(actu)
+
+    # Its also good practice to get sensors and actuators by name
+    # rather then index so any changes to their order wont break the script.
+
+    # sens_key = cont.sensors['key_sensor']
+    # actu_motion = cont.actuators['motion']
+
+
+    # Loop through all other objects in the scene
+    sce = GameLogic.getCurrentScene()
+    print 'Scene Objects:', sce.name
+    for ob in sce.objects:
+        print '   ', ob.name, ob.worldPosition
+
+
+    # Example where collision objects are checked for their properties
+    # adding to our objects "life" property
+    """
+    actu_collide = cont.sensors['collision_sens']
+    for ob in actu_collide.objectHitList:
+        # Check to see the object has this property
+        if ob.has_key('life'):
+            own['life'] += ob['life']
+            ob['life'] = 0
+    print own['life']
+    """
 
 main()
index c9c2a5943090c0fb9ab626a3a5a6db67e62c2f85..5e7d19672feb39baaa6e61567214b9e3bd91cc91 100644 (file)
@@ -1,15 +1,15 @@
 
 def main():
 
-       cont = GameLogic.getCurrentController()
-       own = cont.owner
-       
-       sens = cont.sensors['mySensor']
-       actu = cont.actuators['myActuator']
-       
-       if sens.positive:
-               cont.activate(actu)
-       else:
-               cont.deactivate(actu)
+    cont = GameLogic.getCurrentController()
+    own = cont.owner
+
+    sens = cont.sensors['mySensor']
+    actu = cont.actuators['myActuator']
+
+    if sens.positive:
+        cont.activate(actu)
+    else:
+        cont.deactivate(actu)
 
 main()
index 1bc221e727d84b65d2a72797eee433dfacf78ebf..5a61a3592dc1ccd9b73d31907f30e6748c4b1033 100644 (file)
@@ -13,14 +13,14 @@ import GameLogic
 # with multiple objects.
 
 def main(cont):
-       own = cont.owner
-       
-       sens = cont.sensors['mySensor']
-       actu = cont.actuators['myActuator']
-       
-       if sens.positive:
-               cont.activate(actu)
-       else:
-               cont.deactivate(actu)
+    own = cont.owner
+
+    sens = cont.sensors['mySensor']
+    actu = cont.actuators['myActuator']
+
+    if sens.positive:
+        cont.activate(actu)
+    else:
+        cont.deactivate(actu)
 
 # dont call main(GameLogic.getCurrentController()), the py controller will
index c03d5850237c9fc490ed861a0778fc9a763b590b..3e9e65f13f823659000ef1a9e0fb3ec73683f8c8 100644 (file)
@@ -1,46 +1,46 @@
 import bpy
 
 def write_some_data(context, path, use_some_setting):
-       pass
+    pass
 
 from bpy.props import *
 
 class ExportSomeData(bpy.types.Operator):
-       '''This appiers in the tooltip of the operator and in the generated docs.'''
-       bl_idname = "export.some_data" # this is important since its how bpy.ops.export.some_data is constructed
-       bl_label = "Export Some Data"
-       
-       # List of operator properties, the attributes will be assigned
-       # to the class instance from the operator settings before calling.
-       
-       # TODO, add better example props
-       path = StringProperty(name="File Path", description="File path used for exporting the PLY file", maxlen= 1024, default= "")
-       use_some_setting = BoolProperty(name="Apply Modifiers", description="Apply Modifiers to the exported mesh", default= True)
-       
-       def poll(self, context):
-               return context.active_object != None
-       
-       def execute(self, context):
-               if not self.is_property_set("path"):
-                       raise Exception("filename not set")
-               
-               write(self.path, context, use_setting, SOME_SETTING = self.use_some_setting)
-
-               return ('FINISHED',)
-       
-       def invoke(self, context, event):
-               wm = context.manager
-               
-               if True:
-                       # File selector
-                       wm.add_fileselect(self.__operator__) # will run self.execute()
-                       return ('RUNNING_MODAL',)
-               else if 0:
-                       # Redo popup
-                       wm.invoke_props_popup(self.__operator__, event) # 
-                       return ('RUNNING_MODAL',)
-               else if 0:
-                       return self.execute(context)
+    '''This appiers in the tooltip of the operator and in the generated docs.'''
+    bl_idname = "export.some_data" # this is important since its how bpy.ops.export.some_data is constructed
+    bl_label = "Export Some Data"
+
+    # List of operator properties, the attributes will be assigned
+    # to the class instance from the operator settings before calling.
+
+    # TODO, add better example props
+    path = StringProperty(name="File Path", description="File path used for exporting the PLY file", maxlen= 1024, default= "")
+    use_some_setting = BoolProperty(name="Apply Modifiers", description="Apply Modifiers to the exported mesh", default= True)
+
+    def poll(self, context):
+        return context.active_object != None
+
+    def execute(self, context):
+        if not self.is_property_set("path"):
+            raise Exception("filename not set")
+
+        write(self.path, context, use_setting, SOME_SETTING = self.use_some_setting)
+
+        return ('FINISHED',)
+
+    def invoke(self, context, event):
+        wm = context.manager
+
+        if True:
+            # File selector
+            wm.add_fileselect(self.__operator__) # will run self.execute()
+            return ('RUNNING_MODAL',)
+        else if 0:
+            # Redo popup
+            wm.invoke_props_popup(self.__operator__, event) #
+            return ('RUNNING_MODAL',)
+        else if 0:
+            return self.execute(context)
 
 
 bpy.ops.add(ExportSomeData)
@@ -52,4 +52,4 @@ menu_item = dynamic_menu.add(bpy.types.INFO_MT_file_export, menu_func)
 
 # Use for running this script directly
 if __name__ == "__main__":
-       bpy.ops.export.some_data(path="/tmp/test.ply")
\ No newline at end of file
+    bpy.ops.export.some_data(path="/tmp/test.ply")
index f0f4b104950371d27e37aeb2165b04a419b905ae..b19ce981833133b19cf6462f7d94e0e30c29717a 100644 (file)
@@ -1,20 +1,20 @@
 def main(context):
-       for ob in context.scene.objects:
-               print(ob)
-       
+    for ob in context.scene.objects:
+        print(ob)
+
 class SimpleOperator(bpy.types.Operator):
-       ''''''
-       bl_idname = "object.simple_operator"
-       bl_label = "Simple Object Operator"
-       
-       def poll(self, context):
-               return context.active_object != None
-       
-       def execute(self, context):
-               main(context)
-               return ('FINISHED',)
+    ''''''
+    bl_idname = "object.simple_operator"
+    bl_label = "Simple Object Operator"
+
+    def poll(self, context):
+        return context.active_object != None
+
+    def execute(self, context):
+        main(context)
+        return ('FINISHED',)
 
 bpy.ops.add(SimpleOperator)
 
 if __name__ == "__main__":
-       bpy.ops.object.simple_operator()
+    bpy.ops.object.simple_operator()
index 75264f5d7ec94d70b19e40b5051dfc7eb12035e4..b4abce01e4d7883e852f72db4e37d4251f14aaf0 100644 (file)
 
 import bpy
+
 class DataButtonsPanel(bpy.types.Panel):
-       bl_space_type = 'PROPERTIES'
-       bl_region_type = 'WINDOW'
-       bl_context = "data"
-       
-       def poll(self, context):
-               return context.armature
+    bl_space_type = 'PROPERTIES'
+    bl_region_type = 'WINDOW'
+    bl_context = "data"
+
+    def poll(self, context):
+        return context.armature
 
 class DATA_PT_context_arm(DataButtonsPanel):
-       bl_label = ""
-       bl_show_header = False
-       
-       def draw(self, context):
-               layout = self.layout
-               
-               ob = context.object
-               arm = context.armature
-               space = context.space_data
-
-               split = layout.split(percentage=0.65)
-
-               if ob:
-                       split.template_ID(ob, "data")
-                       split.itemS()
-               elif arm:
-                       split.template_ID(space, "pin_id")
-                       split.itemS()
+    bl_label = ""
+    bl_show_header = False
+
+    def draw(self, context):
+        layout = self.layout
+
+        ob = context.object
+        arm = context.armature
+        space = context.space_data
+
+        split = layout.split(percentage=0.65)
+
+        if ob:
+            split.template_ID(ob, "data")
+            split.itemS()
+        elif arm:
+            split.template_ID(space, "pin_id")
+            split.itemS()
 
 class DATA_PT_skeleton(DataButtonsPanel):
-       bl_label = "Skeleton"
-       
-       def draw(self, context):
-               layout = self.layout
-               
-               ob = context.object
-               arm = context.armature
-               space = context.space_data
-               
-               layout.itemR(arm, "pose_position", expand=True)
-               
-               split = layout.split()
-
-               col = split.column()
-               col.itemL(text="Layers:")
-               col.itemR(arm, "layer", text="")
-               col.itemL(text="Protected Layers:")
-               col.itemR(arm, "layer_protection", text="")
-               
-               col = split.column()
-               col.itemL(text="Deform:")
-               col.itemR(arm, "deform_vertexgroups", text="Vertex Groups")
-               col.itemR(arm, "deform_envelope", text="Envelopes")
-               col.itemR(arm, "deform_quaternion", text="Quaternion")
-               col.itemR(arm, "deform_bbone_rest", text="B-Bones Rest")
-               
+    bl_label = "Skeleton"
+
+    def draw(self, context):
+        layout = self.layout
+
+        ob = context.object
+        arm = context.armature
+        space = context.space_data
+
+        layout.itemR(arm, "pose_position", expand=True)
+
+        split = layout.split()
+
+        col = split.column()
+        col.itemL(text="Layers:")
+        col.itemR(arm, "layer", text="")
+        col.itemL(text="Protected Layers:")
+        col.itemR(arm, "layer_protection", text="")
+
+        col = split.column()
+        col.itemL(text="Deform:")
+        col.itemR(arm, "deform_vertexgroups", text="Vertex Groups")
+        col.itemR(arm, "deform_envelope", text="Envelopes")
+        col.itemR(arm, "deform_quaternion", text="Quaternion")
+        col.itemR(arm, "deform_bbone_rest", text="B-Bones Rest")
+
 class DATA_PT_display(DataButtonsPanel):
-       bl_label = "Display"
-       
-       def draw(self, context):
-               layout = self.layout
-               
-               arm = context.armature
-
-               layout.row().itemR(arm, "drawtype", expand=True)
-
-               flow = layout.column_flow()
-               flow.itemR(arm, "draw_names", text="Names")
-               flow.itemR(arm, "draw_axes", text="Axes")
-               flow.itemR(arm, "draw_custom_bone_shapes", text="Shapes")
-               flow.itemR(arm, "draw_group_colors", text="Colors")
-               flow.itemR(arm, "delay_deform", text="Delay Refresh")
+    bl_label = "Display"
+
+    def draw(self, context):
+        layout = self.layout
+
+        arm = context.armature
+
+        layout.row().itemR(arm, "drawtype", expand=True)
+
+        flow = layout.column_flow()
+        flow.itemR(arm, "draw_names", text="Names")
+        flow.itemR(arm, "draw_axes", text="Axes")
+        flow.itemR(arm, "draw_custom_bone_shapes", text="Shapes")
+        flow.itemR(arm, "draw_group_colors", text="Colors")
+        flow.itemR(arm, "delay_deform", text="Delay Refresh")
 
 class DATA_PT_bone_groups(DataButtonsPanel):
-       bl_label = "Bone Groups"
-       
-       def poll(self, context):
-               return (context.object and context.object.type=='ARMATURE' and context.object.pose)
-
-       def draw(self, context):
-               layout = self.layout
-               
-               ob = context.object
-               pose = ob.pose
-               
-               row = layout.row()
-               row.template_list(pose, "bone_groups", pose, "active_bone_group_index", rows=2)
-               
-               col = row.column(align=True)
-               col.active = (ob.proxy == None)
-               col.itemO("pose.group_add", icon='ICON_ZOOMIN', text="")
-               col.itemO("pose.group_remove", icon='ICON_ZOOMOUT', text="")
-               
-               group = pose.active_bone_group
-               if group:
-                       col = layout.column()
-                       col.active= (ob.proxy == None)
-                       col.itemR(group, "name")
-                       
-                       split = layout.split(0.5)
-                       split.active= (ob.proxy == None)
-                       split.itemR(group, "color_set")
-                       if group.color_set:
-                               split.template_triColorSet(group, "colors")
-               
-               row = layout.row(align=True)
-               row.active = (ob.proxy == None)
-               
-               row.itemO("pose.group_assign", text="Assign")
-               row.itemO("pose.group_remove", text="Remove") #row.itemO("pose.bone_group_remove_from", text="Remove")
-               #row.itemO("object.bone_group_select", text="Select")
-               #row.itemO("object.bone_group_deselect", text="Deselect")
+    bl_label = "Bone Groups"
+
+    def poll(self, context):
+        return (context.object and context.object.type=='ARMATURE' and context.object.pose)
+
+    def draw(self, context):
+        layout = self.layout
+
+        ob = context.object
+        pose = ob.pose
+
+        row = layout.row()
+        row.template_list(pose, "bone_groups", pose, "active_bone_group_index", rows=2)
+
+        col = row.column(align=True)
+        col.active = (ob.proxy == None)
+        col.itemO("pose.group_add", icon='ICON_ZOOMIN', text="")
+        col.itemO("pose.group_remove", icon='ICON_ZOOMOUT', text="")
+
+        group = pose.active_bone_group
+        if group:
+            col = layout.column()
+            col.active= (ob.proxy == None)
+            col.itemR(group, "name")
+
+            split = layout.split(0.5)
+            split.active= (ob.proxy == None)
+            split.itemR(group, "color_set")
+            if group.color_set:
+                split.template_triColorSet(group, "colors")
+
+        row = layout.row(align=True)
+        row.active = (ob.proxy == None)
+
+        row.itemO("pose.group_assign", text="Assign")
+        row.itemO("pose.group_remove", text="Remove") #row.itemO("pose.bone_group_remove_from", text="Remove")
+        #row.itemO("object.bone_group_select", text="Select")
+        #row.itemO("object.bone_group_deselect", text="Deselect")
 
 class DATA_PT_paths(DataButtonsPanel):
-       bl_label = "Paths"
-
-       def draw(self, context):
-               layout = self.layout
-               
-               arm = context.armature
-               
-               layout.itemR(arm, "paths_type", expand=True)
-               
-               split = layout.split()
-               
-               col = split.column()
-               sub = col.column(align=True)
-               if (arm.paths_type == 'CURRENT_FRAME'):
-                       sub.itemR(arm, "path_before_current", text="Before")
-                       sub.itemR(arm, "path_after_current", text="After")
-               elif (arm.paths_type == 'RANGE'):
-                       sub.itemR(arm, "path_start_frame", text="Start")
-                       sub.itemR(arm, "path_end_frame", text="End")
-
-               sub.itemR(arm, "path_size", text="Step")
-               col.row().itemR(arm, "paths_location", expand=True)
-               
-               col = split.column()
-               col.itemL(text="Display:")
-               col.itemR(arm, "paths_show_frame_numbers", text="Frame Numbers")
-               col.itemR(arm, "paths_highlight_keyframes", text="Keyframes")
-               col.itemR(arm, "paths_show_keyframe_numbers", text="Keyframe Numbers")
-               
-               layout.itemS()
-               
-               row = layout.row()
-               row.itemO("pose.paths_calculate", text="Calculate Paths")
-               row.itemO("pose.paths_clear", text="Clear Paths")
+    bl_label = "Paths"
+
+    def draw(self, context):
+        layout = self.layout
+
+        arm = context.armature
+
+        layout.itemR(arm, "paths_type", expand=True)
+
+        split = layout.split()
+
+        col = split.column()
+        sub = col.column(align=True)
+        if (arm.paths_type == 'CURRENT_FRAME'):
+            sub.itemR(arm, "path_before_current", text="Before")
+            sub.itemR(arm, "path_after_current", text="After")
+        elif (arm.paths_type == 'RANGE'):
+            sub.itemR(arm, "path_start_frame", text="Start")
+            sub.itemR(arm, "path_end_frame", text="End")
+
+        sub.itemR(arm, "path_size", text="Step")
+        col.row().itemR(arm, "paths_location", expand=True)
+
+        col = split.column()
+        col.itemL(text="Display:")
+        col.itemR(arm, "paths_show_frame_numbers", text="Frame Numbers")
+        col.itemR(arm, "paths_highlight_keyframes", text="Keyframes")
+        col.itemR(arm, "paths_show_keyframe_numbers", text="Keyframe Numbers")
+
+        layout.itemS()
+
+        row = layout.row()
+        row.itemO("pose.paths_calculate", text="Calculate Paths")
+        row.itemO("pose.paths_clear", text="Clear Paths")
 
 class DATA_PT_ghost(DataButtonsPanel):
-       bl_label = "Ghost"
-
-       def draw(self, context):
-               layout = self.layout
-               
-               arm = context.armature
-               
-               layout.itemR(arm, "ghost_type", expand=True)
-               
-               split = layout.split()
-
-               col = split.column()
-
-               sub = col.column(align=True)
-               if arm.ghost_type == 'RANGE':
-                       sub.itemR(arm, "ghost_start_frame", text="Start")
-                       sub.itemR(arm, "ghost_end_frame", text="End")
-                       sub.itemR(arm, "ghost_size", text="Step")
-               elif arm.ghost_type == 'CURRENT_FRAME':
-                       sub.itemR(arm, "ghost_step", text="Range")
-                       sub.itemR(arm, "ghost_size", text="Step")
-
-               col = split.column()
-               col.itemL(text="Display:")
-               col.itemR(arm, "ghost_only_selected", text="Selected Only")
+    bl_label = "Ghost"
+
+    def draw(self, context):
+        layout = self.layout
+
+        arm = context.armature
+
+        layout.itemR(arm, "ghost_type", expand=True)
+
+        split = layout.split()
+
+        col = split.column()
+
+        sub = col.column(align=True)
+        if arm.ghost_type == 'RANGE':
+            sub.itemR(arm, "ghost_start_frame", text="Start")
+            sub.itemR(arm, "ghost_end_frame", text="End")
+            sub.itemR(arm, "ghost_size", text="Step")
+        elif arm.ghost_type == 'CURRENT_FRAME':
+            sub.itemR(arm, "ghost_step", text="Range")
+            sub.itemR(arm, "ghost_size", text="Step")
+
+        col = split.column()
+        col.itemL(text="Display:")
+        col.itemR(arm, "ghost_only_selected", text="Selected Only")
 
 bpy.types.register(DATA_PT_context_arm)
 bpy.types.register(DATA_PT_skeleton)
index 706c418d0ce2ecaaf99b6542d831e316fb33cb7f..962cb871377fd40579fbe0e9329d30ed3aed5692 100644 (file)
 
 import bpy
+
 class BoneButtonsPanel(bpy.types.Panel):
-       bl_space_type = 'PROPERTIES'
-       bl_region_type = 'WINDOW'
-       bl_context = "bone"
-       
-       def poll(self, context):
-               return (context.bone or context.edit_bone)
+    bl_space_type = 'PROPERTIES'
+    bl_region_type = 'WINDOW'
+    bl_context = "bone"
+
+    def poll(self, context):
+        return (context.bone or context.edit_bone)
 
 class BONE_PT_context_bone(BoneButtonsPanel):
-       bl_label = ""
-       bl_show_header = False
-
-       def draw(self, context):
-               layout = self.layout
-               
-               bone = context.bone
-               if not bone:
-                       bone = context.edit_bone
-               
-               row = layout.row()
-               row.itemL(text="", icon='ICON_BONE_DATA')
-               row.itemR(bone, "name", text="")
+    bl_label = ""
+    bl_show_header = False
+
+    def draw(self, context):
+        layout = self.layout
+
+        bone = context.bone
+        if not bone:
+            bone = context.edit_bone
+
+        row = layout.row()
+        row.itemL(text="", icon='ICON_BONE_DATA')
+        row.itemR(bone, "name", text="")
 
 class BONE_PT_transform(BoneButtonsPanel):
-       bl_label = "Transform"
-
-       def draw(self, context):
-               layout = self.layout
-               
-               ob = context.object
-               bone = context.bone
-               if not bone:
-                       bone = context.edit_bone
-
-                       row = layout.row()
-                       row.column().itemR(bone, "head")
-                       row.column().itemR(bone, "tail")
-
-                       col = row.column()
-                       sub = col.column(align=True)
-                       sub.itemL(text="Roll:")
-                       sub.itemR(bone, "roll", text="")
-                       sub.itemL()
-                       sub.itemR(bone, "locked")
-
-               else:
-                       pchan = ob.pose.pose_channels[context.bone.name]
-
-                       row = layout.row()
-                       col = row.column()
-                       col.itemR(pchan, "location")
-                       col.active = not (bone.parent and bone.connected)
-
-                       col = row.column()
-                       if pchan.rotation_mode == 'QUATERNION':
-                               col.itemR(pchan, "rotation_quaternion", text="Rotation")
-                       elif pchan.rotation_mode == 'AXIS_ANGLE':
-                               #col.itemL(text="Rotation")
-                               #col.itemR(pchan, "rotation_angle", text="Angle")
-                               #col.itemR(pchan, "rotation_axis", text="Axis")
-                               col.itemR(pchan, "rotation_axis_angle", text="Rotation")
-                       else:
-                               col.itemR(pchan, "rotation_euler", text="Rotation")
-
-                       row.column().itemR(pchan, "scale")
-                       
-                       layout.itemR(pchan, "rotation_mode")
-                               
+    bl_label = "Transform"
+
+    def draw(self, context):
+        layout = self.layout
+
+        ob = context.object
+        bone = context.bone
+        if not bone:
+            bone = context.edit_bone
+
+            row = layout.row()
+            row.column().itemR(bone, "head")
+            row.column().itemR(bone, "tail")
+
+            col = row.column()
+            sub = col.column(align=True)
+            sub.itemL(text="Roll:")
+            sub.itemR(bone, "roll", text="")
+            sub.itemL()
+            sub.itemR(bone, "locked")
+
+        else:
+            pchan = ob.pose.pose_channels[context.bone.name]
+
+            row = layout.row()
+            col = row.column()
+            col.itemR(pchan, "location")
+            col.active = not (bone.parent and bone.connected)
+
+            col = row.column()
+            if pchan.rotation_mode == 'QUATERNION':
+                col.itemR(pchan, "rotation_quaternion", text="Rotation")
+            elif pchan.rotation_mode == 'AXIS_ANGLE':
+                #col.itemL(text="Rotation")
+                #col.itemR(pchan, "rotation_angle", text="Angle")
+                #col.itemR(pchan, "rotation_axis", text="Axis")
+                col.itemR(pchan, "rotation_axis_angle", text="Rotation")
+            else:
+                col.itemR(pchan, "rotation_euler", text="Rotation")
+
+            row.column().itemR(pchan, "scale")
+
+            layout.itemR(pchan, "rotation_mode")
+
 class BONE_PT_transform_locks(BoneButtonsPanel):
-       bl_label = "Transform Locks"
-       bl_default_closed = True
-       
-       def poll(self, context):
-               return context.bone
-       
-       def draw(self, context):
-               layout = self.layout
-               
-               ob = context.object
-               bone = context.bone
-               pchan = ob.pose.pose_channels[context.bone.name]
-               
-               row = layout.row()
-               col = row.column()
-               col.itemR(pchan, "lock_location")
-               col.active = not (bone.parent and bone.connected)
-               
-               col = row.column()
-               if pchan.rotation_mode in ('QUATERNION', 'AXIS_ANGLE'):
-                       col.itemR(pchan, "lock_rotations_4d", text="Lock Rotation")
-                       if pchan.lock_rotations_4d:
-                               col.itemR(pchan, "lock_rotation_w", text="W")
-                       col.itemR(pchan, "lock_rotation", text="")
-               else:
-                       col.itemR(pchan, "lock_rotation", text="Rotation")
-               
-               row.column().itemR(pchan, "lock_scale")
+    bl_label = "Transform Locks"
+    bl_default_closed = True
+
+    def poll(self, context):
+        return context.bone
+
+    def draw(self, context):
+        layout = self.layout
+
+        ob = context.object
+        bone = context.bone
+        pchan = ob.pose.pose_channels[context.bone.name]
+
+        row = layout.row()
+        col = row.column()
+        col.itemR(pchan, "lock_location")
+        col.active = not (bone.parent and bone.connected)
+
+        col = row.column()
+        if pchan.rotation_mode in ('QUATERNION', 'AXIS_ANGLE'):
+            col.itemR(pchan, "lock_rotations_4d", text="Lock Rotation")
+            if pchan.lock_rotations_4d:
+                col.itemR(pchan, "lock_rotation_w", text="W")
+            col.itemR(pchan, "lock_rotation", text="")
+        else:
+            col.itemR(pchan, "lock_rotation", text="Rotation")
+
+        row.column().itemR(pchan, "lock_scale")
 
 class BONE_PT_relations(BoneButtonsPanel):
-       bl_label = "Relations"
-
-       def draw(self, context):
-               layout = self.layout
-               
-               ob = context.object
-               bone = context.bone
-               arm = context.armature
-               
-               if not bone:
-                       bone = context.edit_bone
-                       pchan = None
-               else:
-                       pchan = ob.pose.pose_channels[context.bone.name]
-
-               split = layout.split()
-               
-               col = split.column()
-               col.itemL(text="Layers:")
-               col.itemR(bone, "layer", text="")
-               
-               col.itemS()
-               
-               if ob and pchan:
-                       col.itemL(text="Bone Group:")
-                       col.item_pointerR(pchan, "bone_group", ob.pose, "bone_groups", text="")
-               
-               col = split.column()
-               col.itemL(text="Parent:")
-               if context.bone:
-                       col.itemR(bone, "parent", text="")
-               else:
-                       col.item_pointerR(bone, "parent", arm, "edit_bones", text="")
-               
-               sub = col.column()
-               sub.active = bone.parent != None
-               sub.itemR(bone, "connected")
-               sub.itemR(bone, "hinge", text="Inherit Rotation")
-               sub.itemR(bone, "inherit_scale", text="Inherit Scale")
+    bl_label = "Relations"
+
+    def draw(self, context):
+        layout = self.layout
+
+        ob = context.object
+        bone = context.bone
+        arm = context.armature
+
+        if not bone:
+            bone = context.edit_bone
+            pchan = None
+        else:
+            pchan = ob.pose.pose_channels[context.bone.name]
+
+        split = layout.split()
+
+        col = split.column()
+        col.itemL(text="Layers:")
+        col.itemR(bone, "layer", text="")
+
+        col.itemS()
+
+        if ob and pchan:
+            col.itemL(text="Bone Group:")
+            col.item_pointerR(pchan, "bone_group", ob.pose, "bone_groups", text="")
+
+        col = split.column()
+        col.itemL(text="Parent:")
+        if context.bone:
+            col.itemR(bone, "parent", text="")
+        else:
+            col.item_pointerR(bone, "parent", arm, "edit_bones", text="")
+
+        sub = col.column()
+        sub.active = bone.parent != None
+        sub.itemR(bone, "connected")
+        sub.itemR(bone, "hinge", text="Inherit Rotation")
+        sub.itemR(bone, "inherit_scale", text="Inherit Scale")
 
 class BONE_PT_display(BoneButtonsPanel):
-       bl_label = "Display"
-       
-       def poll(self, context):
-               return context.bone
-       
-       def draw(self, context):
-               layout = self.layout
-               
-               ob = context.object
-               bone = context.bone
-               arm = context.armature
-               
-               if not bone:
-                       bone = context.edit_bone
-                       pchan = None
-               else:
-                       pchan = ob.pose.pose_channels[context.bone.name]
-               
-               if ob and pchan:
-                       
-                       split = layout.split()
-               
-                       col = split.column()
-                       
-                       col.itemR(bone, "draw_wire", text="Wireframe")
-                       col.itemR(bone, "hidden", text="Hide")
-                       
-                       col = split.column()
-                       
-                       col.itemL(text="Custom Shape:")
-                       col.itemR(pchan, "custom_shape", text="")
+    bl_label = "Display"
+
+    def poll(self, context):
+        return context.bone
+
+    def draw(self, context):
+        layout = self.layout
+
+        ob = context.object
+        bone = context.bone
+        arm = context.armature
+
+        if not bone:
+            bone = context.edit_bone
+            pchan = None
+        else:
+            pchan = ob.pose.pose_channels[context.bone.name]
+
+        if ob and pchan:
+
+            split = layout.split()
+
+            col = split.column()
+
+            col.itemR(bone, "draw_wire", text="Wireframe")
+            col.itemR(bone, "hidden", text="Hide")
+
+            col = split.column()
+
+            col.itemL(text="Custom Shape:")
+            col.itemR(pchan, "custom_shape", text="")
 
 class BONE_PT_deform(BoneButtonsPanel):
-       bl_label = "Deform"
-       bl_default_closed = True
-
-       def draw_header(self, context):
-               bone = context.bone
-               
-               if not bone:
-                       bone = context.edit_bone
-                       
-               self.layout.itemR(bone, "deform", text="")
-
-       def draw(self, context):
-               layout = self.layout
-               
-               bone = context.bone
-               
-               if not bone:
-                       bone = context.edit_bone
-       
-               layout.active = bone.deform
-                       
-               split = layout.split()
-
-               col = split.column()
-               col.itemL(text="Envelope:")
-               
-               sub = col.column(align=True)
-               sub.itemR(bone, "envelope_distance", text="Distance")
-               sub.itemR(bone, "envelope_weight", text="Weight")
-               col.itemR(bone, "multiply_vertexgroup_with_envelope", text="Multiply")
-
-               sub = col.column(align=True)
-               sub.itemL(text="Radius:")
-               sub.itemR(bone, "head_radius", text="Head")
-               sub.itemR(bone, "tail_radius", text="Tail")
-
-               col = split.column()
-               col.itemL(text="Curved Bones:")
-               
-               sub = col.column(align=True)
-               sub.itemR(bone, "bbone_segments", text="Segments")
-               sub.itemR(bone, "bbone_in", text="Ease In")
-               sub.itemR(bone, "bbone_out", text="Ease Out")
-               
-               col.itemL(text="Offset:")
-               col.itemR(bone, "cyclic_offset")
+    bl_label = "Deform"
+    bl_default_closed = True
+
+    def draw_header(self, context):
+        bone = context.bone
+
+        if not bone:
+            bone = context.edit_bone
+
+        self.layout.itemR(bone, "deform", text="")
+
+    def draw(self, context):
+        layout = self.layout
+
+        bone = context.bone
+
+        if not bone:
+            bone = context.edit_bone
+
+        layout.active = bone.deform
+
+        split = layout.split()
+
+        col = split.column()
+        col.itemL(text="Envelope:")
+
+        sub = col.column(align=True)
+        sub.itemR(bone, "envelope_distance", text="Distance")
+        sub.itemR(bone, "envelope_weight", text="Weight")
+        col.itemR(bone, "multiply_vertexgroup_with_envelope", text="Multiply")
+
+        sub = col.column(align=True)
+        sub.itemL(text="Radius:")
+        sub.itemR(bone, "head_radius", text="Head")
+        sub.itemR(bone, "tail_radius", text="Tail")
+
+        col = split.column()
+        col.itemL(text="Curved Bones:")
+
+        sub = col.column(align=True)
+        sub.itemR(bone, "bbone_segments", text="Segments")
+        sub.itemR(bone, "bbone_in", text="Ease In")
+        sub.itemR(bone, "bbone_out", text="Ease Out")
+
+        col.itemL(text="Offset:")
+        col.itemR(bone, "cyclic_offset")
 
 bpy.types.register(BONE_PT_context_bone)
 bpy.types.register(BONE_PT_transform)
index 1321e42b97d5272e824725be669d7b1cd4095bb5..f0c39dc2593976f73b45c69125be0c02d65fbc38 100644 (file)
@@ -2,97 +2,97 @@
 import bpy
 
 class DataButtonsPanel(bpy.types.Panel):
-       bl_space_type = 'PROPERTIES'
-       bl_region_type = 'WINDOW'
-       bl_context = "data"
+    bl_space_type = 'PROPERTIES'
+    bl_region_type = 'WINDOW'
+    bl_context = "data"
+
+    def poll(self, context):
+        return context.camera
 
-       def poll(self, context):
-               return context.camera
-               
 class DATA_PT_context_camera(DataButtonsPanel):
-       bl_label = ""
-       bl_show_header = False
-       
-       def draw(self, context):
-               layout = self.layout
-               
-               ob = context.object
-               cam = context.camera
-               space = context.space_data
-
-               split = layout.split(percentage=0.65)
-
-               if ob:
-                       split.template_ID(ob, "data")
-                       split.itemS()
-               elif cam:
-                       split.template_ID(space, "pin_id")
-                       split.itemS()
+    bl_label = ""
+    bl_show_header = False
+
+    def draw(self, context):
+        layout = self.layout
+
+        ob = context.object
+        cam = context.camera
+        space = context.space_data
+
+        split = layout.split(percentage=0.65)
+
+        if ob:
+            split.template_ID(ob, "data")
+            split.itemS()
+        elif cam:
+            split.template_ID(space, "pin_id")
+            split.itemS()
 
 class DATA_PT_camera(DataButtonsPanel):
-       bl_label = "Lens"
-
-       def draw(self, context):
-               layout = self.layout
-               
-               cam = context.camera
-
-               layout.itemR(cam, "type", expand=True)
-                       
-               row = layout.row()
-               if cam.type == 'PERSP':
-                       if cam.lens_unit == 'MILLIMETERS':
-                               row.itemR(cam, "lens", text="Angle")
-                       elif cam.lens_unit == 'DEGREES':
-                               row.itemR(cam, "angle")
-                       row.itemR(cam, "lens_unit", text="")
-
-               elif cam.type == 'ORTHO':
-                       row.itemR(cam, "ortho_scale")
-
-               layout.itemR(cam, "panorama")
-                               
-               split = layout.split()
-                       
-               col = split.column(align=True)
-               col.itemL(text="Shift:")
-               col.itemR(cam, "shift_x", text="X")
-               col.itemR(cam, "shift_y", text="Y")
-                       
-               col = split.column(align=True)
-               col.itemL(text="Clipping:")
-               col.itemR(cam, "clip_start", text="Start")
-               col.itemR(cam, "clip_end", text="End")
-                       
-               layout.itemL(text="Depth of Field:")
-               
-               row = layout.row()
-               row.itemR(cam, "dof_object", text="")
-               row.itemR(cam, "dof_distance", text="Distance")
-               
+    bl_label = "Lens"
+
+    def draw(self, context):
+        layout = self.layout
+
+        cam = context.camera
+
+        layout.itemR(cam, "type", expand=True)
+
+        row = layout.row()
+        if cam.type == 'PERSP':
+            if cam.lens_unit == 'MILLIMETERS':
+                row.itemR(cam, "lens", text="Angle")
+            elif cam.lens_unit == 'DEGREES':
+                row.itemR(cam, "angle")
+            row.itemR(cam, "lens_unit", text="")
+
+        elif cam.type == 'ORTHO':
+            row.itemR(cam, "ortho_scale")
+
+        layout.itemR(cam, "panorama")
+
+        split = layout.split()
+
+        col = split.column(align=True)
+        col.itemL(text="Shift:")
+        col.itemR(cam, "shift_x", text="X")
+        col.itemR(cam, "shift_y", text="Y")
+
+        col = split.column(align=True)
+        col.itemL(text="Clipping:")
+        col.itemR(cam, "clip_start", text="Start")
+        col.itemR(cam, "clip_end", text="End")
+
+        layout.itemL(text="Depth of Field:")
+
+        row = layout.row()
+        row.itemR(cam, "dof_object", text="")
+        row.itemR(cam, "dof_distance", text="Distance")
+
 class DATA_PT_camera_display(DataButtonsPanel):
-       bl_label = "Display"
-
-       def draw(self, context):
-               layout = self.layout
-               
-               cam = context.camera
-
-               split = layout.split()
-               
-               col = split.column()
-               col.itemR(cam, "show_limits", text="Limits")
-               col.itemR(cam, "show_mist", text="Mist")
-               col.itemR(cam, "show_title_safe", text="Title Safe")
-               col.itemR(cam, "show_name", text="Name")
-                       
-               col = split.column()
-               col.itemR(cam, "draw_size", text="Size")
-               col.itemS()
-               col.itemR(cam, "show_passepartout", text="Passepartout")
-               sub = col.column()
-               sub.active = cam.show_passepartout
-               sub.itemR(cam, "passepartout_alpha", text="Alpha", slider=True)
+    bl_label = "Display"
+
+    def draw(self, context):
+        layout = self.layout
+
+        cam = context.camera
+
+        split = layout.split()
+
+        col = split.column()
+        col.itemR(cam, "show_limits", text="Limits")
+        col.itemR(cam, "show_mist", text="Mist")
+        col.itemR(cam, "show_title_safe", text="Title Safe")
+        col.itemR(cam, "show_name", text="Name")
+
+        col = split.column()
+        col.itemR(cam, "draw_size", text="Size")
+        col.itemS()
+        col.itemR(cam, "show_passepartout", text="Passepartout")
+        sub = col.column()
+        sub.active = cam.show_passepartout
+        sub.itemR(cam, "passepartout_alpha", text="Alpha", slider=True)
 
 bpy.types.register(DATA_PT_context_camera)
 bpy.types.register(DATA_PT_camera)
index 90d84dc09ed0e5f4b8f2ef6048539af814556f52..fdb24cab2b1e15f19cd0e508a975cd6cfd6f5f0a 100644 (file)
@@ -2,94 +2,94 @@
 import bpy
 
 class DataButtonsPanel(bpy.types.Panel):
-       bl_space_type = 'PROPERTIES'
-       bl_region_type = 'WINDOW'
-       bl_context = "data"
-       
-       def poll(self, context):
-               return (context.object and context.object.type in ('CURVE', 'SURFACE') and context.curve)
-               
+    bl_space_type = 'PROPERTIES'
+    bl_region_type = 'WINDOW'
+    bl_context = "data"
+
+    def poll(self, context):
+        return (context.object and context.object.type in ('CURVE', 'SURFACE') and context.curve)
+
 class DataButtonsPanelCurve(DataButtonsPanel):
-       '''
-       Same as above but for curves only
-       '''
-       def poll(self, context):
-               return (context.object and context.object.type == 'CURVE' and context.curve)
+    '''
+    Same as above but for curves only
+    '''
+    def poll(self, context):
+        return (context.object and context.object.type == 'CURVE' and context.curve)
 
 class DataButtonsPanelActive(DataButtonsPanel):
-       '''
-       Same as above but for curves only
-       '''
-       def poll(self, context):
-               curve = context.curve
-               return (curve and curve.active_spline)
+    '''
+    Same as above but for curves only
+    '''
+    def poll(self, context):
+        curve = context.curve
+        return (curve and curve.active_spline)
 
 class DATA_PT_context_curve(DataButtonsPanel):
-       bl_label = ""
-       bl_show_header = False
-       
-       def draw(self, context):
-               layout = self.layout
-               
-               ob = context.object
-               curve = context.curve
-               space = context.space_data
-
-               split = layout.split(percentage=0.65)
-
-               if ob:
-                       split.template_ID(ob, "data")
-                       split.itemS()
-               elif curve:
-                       split.template_ID(space, "pin_id")
-                       split.itemS()
+    bl_label = ""
+    bl_show_header = False
+
+    def draw(self, context):
+        layout = self.layout
+
+        ob = context.object
+        curve = context.curve
+        space = context.space_data
+
+        split = layout.split(percentage=0.65)
+
+        if ob:
+            split.template_ID(ob, "data")
+            split.itemS()
+        elif curve:
+            split.template_ID(space, "pin_id")
+            split.itemS()
 
 class DATA_PT_shape_curve(DataButtonsPanel):
-       bl_label = "Shape"
-       
-       def draw(self, context):
-               layout = self.layout
-               
-               ob = context.object
-               curve = context.curve
-               space = context.space_data
-               is_surf = (ob.type == 'SURFACE')
-
-               if not is_surf:
-                       row = layout.row()
-                       row.itemR(curve, "dimensions", expand=True)
-               
-               split = layout.split()
-               
-               col = split.column()
-               
-               if not is_surf:
-                       sub = col.column()
-                       sub.active = (curve.dimensions=='2D')
-                       sub.itemL(text="Caps:")
-                       row = sub.row()
-                       row.itemR(curve, "front")
-                       row.itemR(curve, "back")
-                       
-               col.itemL(text="Textures:")
+    bl_label = "Shape"
+
+    def draw(self, context):
+        layout = self.layout
+
+        ob = context.object
+        curve = context.curve
+        space = context.space_data
+        is_surf = (ob.type == 'SURFACE')
+
+        if not is_surf:
+            row = layout.row()
+            row.itemR(curve, "dimensions", expand=True)
+
+        split = layout.split()
+
+        col = split.column()
+
+        if not is_surf:
+            sub = col.column()
+            sub.active = (curve.dimensions=='2D')
+            sub.itemL(text="Caps:")
+            row = sub.row()
+            row.itemR(curve, "front")
+            row.itemR(curve, "back")
+
+        col.itemL(text="Textures:")
 #              col.itemR(curve, "uv_orco")
-               col.itemR(curve, "auto_texspace")
-                       
-               col = split.column()    
-               col.itemL(text="Resolution:")
-               sub = col.column(align=True)
-               sub.itemR(curve, "resolution_u", text="Preview U")
-               sub.itemR(curve, "render_resolution_u", text="Render U")
-
-               if is_surf:
-                       sub = col.column(align=True)
-                       sub.itemR(curve, "resolution_v", text="Preview V")
-                       sub.itemR(curve, "render_resolution_v", text="Render V")
-               
-               # XXX - put somewhere nicer.
-               row= layout.row()
-               row.itemR(curve, "twist_mode")
-               row.itemR(curve, "twist_smooth") # XXX - may not be kept
+        col.itemR(curve, "auto_texspace")
+
+        col = split.column()
+        col.itemL(text="Resolution:")
+        sub = col.column(align=True)
+        sub.itemR(curve, "resolution_u", text="Preview U")
+        sub.itemR(curve, "render_resolution_u", text="Render U")
+
+        if is_surf:
+            sub = col.column(align=True)
+            sub.itemR(curve, "resolution_v", text="Preview V")
+            sub.itemR(curve, "render_resolution_v", text="Render V")
+
+        # XXX - put somewhere nicer.
+        row= layout.row()
+        row.itemR(curve, "twist_mode")
+        row.itemR(curve, "twist_smooth") # XXX - may not be kept
 
 #              col.itemL(text="Display:")
 #              col.itemL(text="HANDLES")
@@ -97,127 +97,127 @@ class DATA_PT_shape_curve(DataButtonsPanel):
 #              col.itemR(curve, "vertex_normal_flip")
 
 class DATA_PT_geometry_curve(DataButtonsPanel):
-       bl_label = "Geometry"
-
-       def draw(self, context):
-               layout = self.layout
-               
-               curve = context.curve
-
-               split = layout.split()
-       
-               col = split.column()
-               col.itemL(text="Modification:")
-               col.itemR(curve, "width")
-               col.itemR(curve, "extrude")
-               col.itemL(text="Taper Object:")
-               col.itemR(curve, "taper_object", text="")
-               
-               col = split.column()
-               col.itemL(text="Bevel:")
-               col.itemR(curve, "bevel_depth", text="Depth")
-               col.itemR(curve, "bevel_resolution", text="Resolution")
-               col.itemL(text="Bevel Object:")
-               col.itemR(curve, "bevel_object", text="")
+    bl_label = "Geometry"
+
+    def draw(self, context):
+        layout = self.layout
+
+        curve = context.curve
+
+        split = layout.split()
+
+        col = split.column()
+        col.itemL(text="Modification:")
+        col.itemR(curve, "width")
+        col.itemR(curve, "extrude")
+        col.itemL(text="Taper Object:")
+        col.itemR(curve, "taper_object", text="")
+
+        col = split.column()
+        col.itemL(text="Bevel:")
+        col.itemR(curve, "bevel_depth", text="Depth")
+        col.itemR(curve, "bevel_resolution", text="Resolution")
+        col.itemL(text="Bevel Object:")
+        col.itemR(curve, "bevel_object", text="")
 
 class DATA_PT_pathanim(DataButtonsPanelCurve):
-       bl_label = "Path Animation"
-       
-       def draw_header(self, context):
-               curve = context.curve
-
-               self.layout.itemR(curve, "use_path", text="")
-
-       def draw(self, context):
-               layout = self.layout
-               
-               curve = context.curve
-               
-               layout.active = curve.use_path  
-               
-               split = layout.split()          
-               
-               col = split.column()
-               col.itemR(curve, "path_length", text="Frames")
-               col.itemR(curve, "use_path_follow")
-
-               col = split.column()
-               col.itemR(curve, "use_stretch")
-               col.itemR(curve, "use_radius")
-               col.itemR(curve, "use_time_offset", text="Offset Children")
-       
+    bl_label = "Path Animation"
+
+    def draw_header(self, context):
+        curve = context.curve
+
+        self.layout.itemR(curve, "use_path", text="")
+
+    def draw(self, context):
+        layout = self.layout
+
+        curve = context.curve
+
+        layout.active = curve.use_path
+
+        split = layout.split()
+
+        col = split.column()
+        col.itemR(curve, "path_length", text="Frames")
+        col.itemR(curve, "use_path_follow")
+
+        col = split.column()
+        col.itemR(curve, "use_stretch")
+        col.itemR(curve, "use_radius")
+        col.itemR(curve, "use_time_offset", text="Offset Children")
+
 class DATA_PT_active_spline(DataButtonsPanelActive):
-       bl_label = "Active Spline"
-
-       def draw(self, context):
-               layout = self.layout
-               
-               ob = context.object
-               curve = context.curve
-               act_spline = curve.active_spline
-               is_surf = (ob.type == 'SURFACE')
-               is_poly = (act_spline.type == 'POLY')
-               
-               split = layout.split()
-               
-               if is_poly:
-                       # These settings are below but its easier to have 
-                       # poly's set aside since they use so few settings
-                       col = split.column()
-                       col.itemL(text="Cyclic:")
-                       col.itemR(act_spline, "smooth")
-                       col = split.column()
-                       col.itemR(act_spline, "cyclic_u", text="U")
-               
-               else:
-                       col = split.column()
-                       col.itemL(text="Cyclic:")
-                       if act_spline.type == 'NURBS':
-                               col.itemL(text="Bezier:")
-                               col.itemL(text="Endpoint:")
-                               col.itemL(text="Order:")
-                       
-                       col.itemL(text="Resolution:")
-                                       
-                       col = split.column()
-                       col.itemR(act_spline, "cyclic_u", text="U")
-                       
-                       if act_spline.type == 'NURBS':
-                               sub = col.column()
-                               # sub.active = (not act_spline.cyclic_u)
-                               sub.itemR(act_spline, "bezier_u", text="U")
-                               sub.itemR(act_spline, "endpoint_u", text="U")
-                               
-                               sub = col.column()
-                               sub.itemR(act_spline, "order_u", text="U")
-                       col.itemR(act_spline, "resolution_u", text="U")
-                       
-                       if is_surf:
-                               col = split.column()
-                               col.itemR(act_spline, "cyclic_v", text="V")
-                               
-                               # its a surface, assume its a nurb.
-                               sub = col.column()
-                               sub.active = (not act_spline.cyclic_v)
-                               sub.itemR(act_spline, "bezier_v", text="V")
-                               sub.itemR(act_spline, "endpoint_v", text="V")
-                               sub = col.column()
-                               sub.itemR(act_spline, "order_v", text="V")
-                               sub.itemR(act_spline, "resolution_v", text="V")
-
-                       
-                       if not is_surf:
-                               split = layout.split()
-                               col = split.column()
-                               col.active = (curve.dimensions=='3D')
-                               
-                               col.itemL(text="Interpolation:")
-                               col.itemR(act_spline, "tilt_interpolation", text="Tilt")
-                               col.itemR(act_spline, "radius_interpolation", text="Radius")
-                       
-                       split = layout.split()
-                       col = split.column()
-                       col.itemR(act_spline, "smooth")
+    bl_label = "Active Spline"
+
+    def draw(self, context):
+        layout = self.layout
+
+        ob = context.object
+        curve = context.curve
+        act_spline = curve.active_spline
+        is_surf = (ob.type == 'SURFACE')
+        is_poly = (act_spline.type == 'POLY')
+
+        split = layout.split()
+
+        if is_poly:
+            # These settings are below but its easier to have
+            # poly's set aside since they use so few settings
+            col = split.column()
+            col.itemL(text="Cyclic:")
+            col.itemR(act_spline, "smooth")
+            col = split.column()
+            col.itemR(act_spline, "cyclic_u", text="U")
+
+        else:
+            col = split.column()
+            col.itemL(text="Cyclic:")
+            if act_spline.type == 'NURBS':
+                col.itemL(text="Bezier:")
+                col.itemL(text="Endpoint:")
+                col.itemL(text="Order:")
+
+            col.itemL(text="Resolution:")
+
+            col = split.column()
+            col.itemR(act_spline, "cyclic_u", text="U")
+
+            if act_spline.type == 'NURBS':
+                sub = col.column()
+                # sub.active = (not act_spline.cyclic_u)
+                sub.itemR(act_spline, "bezier_u", text="U")
+                sub.itemR(act_spline, "endpoint_u", text="U")
+
+                sub = col.column()
+                sub.itemR(act_spline, "order_u", text="U")
+            col.itemR(act_spline, "resolution_u", text="U")
+
+            if is_surf:
+                col = split.column()
+                col.itemR(act_spline, "cyclic_v", text="V")
+
+                # its a surface, assume its a nurb.
+                sub = col.column()
+                sub.active = (not act_spline.cyclic_v)
+                sub.itemR(act_spline, "bezier_v", text="V")
+                sub.itemR(act_spline, "endpoint_v", text="V")
+                sub = col.column()
+                sub.itemR(act_spline, "order_v", text="V")
+                sub.itemR(act_spline, "resolution_v", text="V")
+
+
+            if not is_surf:
+                split = layout.split()
+                col = split.column()
+                col.active = (curve.dimensions=='3D')
+
+                col.itemL(text="Interpolation:")
+                col.itemR(act_spline, "tilt_interpolation", text="Tilt")
+                col.itemR(act_spline, "radius_interpolation", text="Radius")
+
+            split = layout.split()
+            col = split.column()
+            col.itemR(act_spline, "smooth")
 
 bpy.types.register(DATA_PT_context_curve)
 bpy.types.register(DATA_PT_shape_curve)
index 652f470a605bd34921f0c7135b63003a96fccfb6..5fe864ee7a2d0df28c813642540033cfc427c4b1 100644 (file)
@@ -2,22 +2,22 @@
 import bpy
 
 class DataButtonsPanel(bpy.types.Panel):
-       bl_space_type = 'PROPERTIES'
-       bl_region_type = 'WINDOW'
-       bl_context = "data"
-       
-       def poll(self, context):
-               return (context.object and context.object.type == 'EMPTY')
-       
+    bl_space_type = 'PROPERTIES'
+    bl_region_type = 'WINDOW'
+    bl_context = "data"
+
+    def poll(self, context):
+        return (context.object and context.object.type == 'EMPTY')
+
 class DATA_PT_empty(DataButtonsPanel):
-       bl_label = "Empty"
+    bl_label = "Empty"
+
+    def draw(self, context):
+        layout = self.layout
+
+        ob = context.object
 
-       def draw(self, context):
-               layout = self.layout
-               
-               ob = context.object
+        layout.itemR(ob, "empty_draw_type", text="Display")
+        layout.itemR(ob, "empty_draw_size", text="Size")
 
-               layout.itemR(ob, "empty_draw_type", text="Display")
-               layout.itemR(ob, "empty_draw_size", text="Size")
-               
 bpy.types.register(DATA_PT_empty)
index 0d38470102983016fa9d09c44ce6cc91bc6a62f8..c7c25bfd090cb760a7212b130a111e41f57396f7 100644 (file)
 import bpy
 
 class DataButtonsPanel(bpy.types.Panel):
-       bl_space_type = 'PROPERTIES'
-       bl_region_type = 'WINDOW'
-       bl_context = "data"
-       
-       def poll(self, context):
-               return context.lamp
-               
+    bl_space_type = 'PROPERTIES'
+    bl_region_type = 'WINDOW'
+    bl_context = "data"
+
+    def poll(self, context):
+        return context.lamp
+
 class DATA_PT_preview(DataButtonsPanel):
-       bl_label = "Preview"
+    bl_label = "Preview"
+
+    def draw(self, context):
+        self.layout.template_preview(context.lamp)
 
-       def draw(self, context):
-               self.layout.template_preview(context.lamp)
-       
 class DATA_PT_context_lamp(DataButtonsPanel):
-       bl_label = ""
-       bl_show_header = False
-       
-       def draw(self, context):
-               layout = self.layout
-               
-               ob = context.object
-               lamp = context.lamp
-               space = context.space_data
-
-               split = layout.split(percentage=0.65)
-
-               if ob:
-                       split.template_ID(ob, "data")
-                       split.itemS()
-               elif lamp:
-                       split.template_ID(space, "pin_id")
-                       split.itemS()
+    bl_label = ""
+    bl_show_header = False
+
+    def draw(self, context):
+        layout = self.layout
+
+        ob = context.object
+        lamp = context.lamp
+        space = context.space_data
+
+        split = layout.split(percentage=0.65)
+
+        if ob:
+            split.template_ID(ob, "data")
+            split.itemS()
+        elif lamp:
+            split.template_ID(space, "pin_id")
+            split.itemS()
 
 class DATA_PT_lamp(DataButtonsPanel):
-       bl_label = "Lamp"
-
-       def draw(self, context):
-               layout = self.layout
-               
-               lamp = context.lamp
-               
-               layout.itemR(lamp, "type", expand=True)
-               
-               split = layout.split()
-               
-               col = split.column()
-               sub = col.column()
-               sub.itemR(lamp, "color", text="")
-               sub.itemR(lamp, "energy")
-
-               if lamp.type in ('POINT', 'SPOT'):
-                       sub.itemL(text="Falloff:")
-                       sub.itemR(lamp, "falloff_type", text="")
-                       sub.itemR(lamp, "distance")
-
-                       if lamp.falloff_type == 'LINEAR_QUADRATIC_WEIGHTED':
-                               col.itemL(text="Attenuation Factors:")
-                               sub = col.column(align=True)
-                               sub.itemR(lamp, "linear_attenuation", slider=True, text="Linear")
-                               sub.itemR(lamp, "quadratic_attenuation", slider=True, text="Quadratic")
-                       
-                       col.itemR(lamp, "sphere")
-                       
-               if lamp.type == 'AREA':
-                       col.itemR(lamp, "distance")
-                       col.itemR(lamp, "gamma")
-       
-               col = split.column()
-               col.itemR(lamp, "negative")
-               col.itemR(lamp, "layer", text="This Layer Only")
-               col.itemR(lamp, "specular")
-               col.itemR(lamp, "diffuse")      
+    bl_label = "Lamp"
+
+    def draw(self, context):
+        layout = self.layout
+
+        lamp = context.lamp
+
+        layout.itemR(lamp, "type", expand=True)
+
+        split = layout.split()
+
+        col = split.column()
+        sub = col.column()
+        sub.itemR(lamp, "color", text="")
+        sub.itemR(lamp, "energy")
+
+        if lamp.type in ('POINT', 'SPOT'):
+            sub.itemL(text="Falloff:")
+            sub.itemR(lamp, "falloff_type", text="")
+            sub.itemR(lamp, "distance")
+
+            if lamp.falloff_type == 'LINEAR_QUADRATIC_WEIGHTED':
+                col.itemL(text="Attenuation Factors:")
+                sub = col.column(align=True)
+                sub.itemR(lamp, "linear_attenuation", slider=True, text="Linear")
+                sub.itemR(lamp, "quadratic_attenuation", slider=True, text="Quadratic")
+
+            col.itemR(lamp, "sphere")
+
+        if lamp.type == 'AREA':
+            col.itemR(lamp, "distance")
+            col.itemR(lamp, "gamma")
+
+        col = split.column()
+        col.itemR(lamp, "negative")
+        col.itemR(lamp, "layer", text="This Layer Only")
+        col.itemR(lamp, "specular")
+        col.itemR(lamp, "diffuse")
 
 class DATA_PT_sunsky(DataButtonsPanel):
-       bl_label = "Sky & Atmosphere"
-       
-       def poll(self, context):
-               lamp = context.lamp
-               return (lamp and lamp.type == 'SUN')
-
-       def draw(self, context):
-               layout = self.layout
-               
-               lamp = context.lamp.sky
-
-               layout.itemR(lamp, "sky")
-
-               row = layout.row()
-               row.active = lamp.sky or lamp.atmosphere
-               row.itemR(lamp, "atmosphere_turbidity", text="Turbidity")
-                       
-               split = layout.split()
-               
-               col = split.column()
-               col.active = lamp.sky
-               col.itemL(text="Blending:")
-               sub = col.column()
-               sub.itemR(lamp, "sky_blend_type", text="")
-               sub.itemR(lamp, "sky_blend", text="Factor")
-               
-               col.itemL(text="Color Space:")
-               sub = col.column()
-               sub.row().itemR(lamp, "sky_color_space", expand=True)
-               sub.itemR(lamp, "sky_exposure", text="Exposure")
-                       
-               col = split.column()
-               col.active = lamp.sky
-               col.itemL(text="Horizon:")
-               sub = col.column()
-               sub.itemR(lamp, "horizon_brightness", text="Brightness")
-               sub.itemR(lamp, "spread", text="Spread")
-               
-               col.itemL(text="Sun:")
-               sub = col.column()
-               sub.itemR(lamp, "sun_brightness", text="Brightness")
-               sub.itemR(lamp, "sun_size", text="Size")
-               sub.itemR(lamp, "backscattered_light", slider=True,text="Back Light")
-               
-               layout.itemS()
-               
-               layout.itemR(lamp, "atmosphere")
-               
-               split = layout.split()
-               
-               col = split.column()
-               col.active = lamp.atmosphere
-               col.itemL(text="Intensity:")
-               col.itemR(lamp, "sun_intensity", text="Sun")
-               col.itemR(lamp, "atmosphere_distance_factor", text="Distance")
-                       
-               col = split.column()
-               col.active = lamp.atmosphere
-               col.itemL(text="Scattering:")
-               sub = col.column(align=True)
-               sub.itemR(lamp, "atmosphere_inscattering", slider=True, text="Inscattering")
-               sub.itemR(lamp, "atmosphere_extinction", slider=True ,text="Extinction")
-               
+    bl_label = "Sky & Atmosphere"
+
+    def poll(self, context):
+        lamp = context.lamp
+        return (lamp and lamp.type == 'SUN')
+
+    def draw(self, context):
+        layout = self.layout
+
+        lamp = context.lamp.sky
+
+        layout.itemR(lamp, "sky")
+
+        row = layout.row()
+        row.active = lamp.sky or lamp.atmosphere
+        row.itemR(lamp, "atmosphere_turbidity", text="Turbidity")
+
+        split = layout.split()
+
+        col = split.column()
+        col.active = lamp.sky
+        col.itemL(text="Blending:")
+        sub = col.column()
+        sub.itemR(lamp, "sky_blend_type", text="")
+        sub.itemR(lamp, "sky_blend", text="Factor")
+
+        col.itemL(text="Color Space:")
+        sub = col.column()
+        sub.row().itemR(lamp, "sky_color_space", expand=True)
+        sub.itemR(lamp, "sky_exposure", text="Exposure")
+
+        col = split.column()
+        col.active = lamp.sky
+        col.itemL(text="Horizon:")
+        sub = col.column()
+        sub.itemR(lamp, "horizon_brightness", text="Brightness")
+        sub.itemR(lamp, "spread", text="Spread")
+
+        col.itemL(text="Sun:")
+        sub = col.column()
+        sub.itemR(lamp, "sun_brightness", text="Brightness")
+        sub.itemR(lamp, "sun_size", text="Size")
+        sub.itemR(lamp, "backscattered_light", slider=True,text="Back Light")
+
+        layout.itemS()
+
+        layout.itemR(lamp, "atmosphere")
+
+        split = layout.split()
+
+        col = split.column()
+        col.active = lamp.atmosphere
+        col.itemL(text="Intensity:")
+        col.itemR(lamp, "sun_intensity", text="Sun")
+        col.itemR(lamp, "atmosphere_distance_factor", text="Distance")
+
+        col = split.column()
+        col.active = lamp.atmosphere
+        col.itemL(text="Scattering:")
+        sub = col.column(align=True)
+        sub.itemR(lamp, "atmosphere_inscattering", slider=True, text="Inscattering")
+        sub.itemR(lamp, "atmosphere_extinction", slider=True ,text="Extinction")
+
 class DATA_PT_shadow(DataButtonsPanel):
-       bl_label = "Shadow"
-       
-       def poll(self, context):
-               lamp = context.lamp
-               return (lamp and lamp.type in ('POINT','SUN', 'SPOT', 'AREA'))
-
-       def draw(self, context):
-               layout = self.layout
-               
-               lamp = context.lamp
-
-               layout.itemR(lamp, "shadow_method", expand=True)
-               
-               if lamp.shadow_method != 'NOSHADOW':
-                       split = layout.split()
-                       
-                       col = split.column()
-                       col.itemR(lamp, "shadow_color", text="")
-                       
-                       col = split.column()
-                       col.itemR(lamp, "shadow_layer", text="This Layer Only")
-                       col.itemR(lamp, "only_shadow")
-               
-               if lamp.shadow_method == 'RAY_SHADOW':
-                       col = layout.column()
-                       col.itemL(text="Sampling:")
-                       col.row().itemR(lamp, "shadow_ray_sampling_method", expand=True)
-                               
-                       if lamp.type in ('POINT', 'SUN', 'SPOT'):
-                               split = layout.split()
-                               
-                               col = split.column()
-                               col.itemR(lamp, "shadow_soft_size", text="Soft Size")
-                               
-                               col.itemR(lamp, "shadow_ray_samples", text="Samples")
-                               if lamp.shadow_ray_sampling_method == 'ADAPTIVE_QMC':
-                                       col.itemR(lamp, "shadow_adaptive_threshold", text="Threshold")
-                               col = split.column()
-                                               
-                       elif lamp.type == 'AREA':
-                               split = layout.split()
-                               
-                               col = split.column()
-                               sub = split.column(align=True)
-                               if lamp.shape == 'SQUARE':
-                                       col.itemR(lamp, "shadow_ray_samples_x", text="Samples")
-                               elif lamp.shape == 'RECTANGLE':
-                                       col.itemR(lamp, "shadow_ray_samples_x", text="Samples X")
-                                       col.itemR(lamp, "shadow_ray_samples_y", text="Samples Y")
-                                       
-                               if lamp.shadow_ray_sampling_method == 'ADAPTIVE_QMC':
-                                       col.itemR(lamp, "shadow_adaptive_threshold", text="Threshold")
-                                       
-                               elif lamp.shadow_ray_sampling_method == 'CONSTANT_JITTERED':
-                                       sub.itemR(lamp, "umbra")
-                                       sub.itemR(lamp, "dither")
-                                       sub.itemR(lamp, "jitter")       
-
-               elif lamp.shadow_method == 'BUFFER_SHADOW':
-                       col = layout.column()
-                       col.itemL(text="Buffer Type:")
-                       col.row().itemR(lamp, "shadow_buffer_type", expand=True)
-
-                       if lamp.shadow_buffer_type in ('REGULAR', 'HALFWAY', 'DEEP'):
-                               split = layout.split()
-                               
-                               col = split.column()
-                               col.itemL(text="Filter Type:")
-                               col.itemR(lamp, "shadow_filter_type", text="")
-                               sub = col.column(align=True)
-                               sub.itemR(lamp, "shadow_buffer_soft", text="Soft")
-                               sub.itemR(lamp, "shadow_buffer_bias", text="Bias")
-                               
-                               col = split.column()
-                               col.itemL(text="Sample Buffers:")
-                               col.itemR(lamp, "shadow_sample_buffers", text="")
-                               sub = col.column(align=True)
-                               sub.itemR(lamp, "shadow_buffer_size", text="Size")
-                               sub.itemR(lamp, "shadow_buffer_samples", text="Samples")
-                               if lamp.shadow_buffer_type == 'DEEP':
-                                       col.itemR(lamp, "compression_threshold")
-                               
-                       elif lamp.shadow_buffer_type == 'IRREGULAR':
-                               layout.itemR(lamp, "shadow_buffer_bias", text="Bias")
-                       
-                       row = layout.row()
-                       row.itemR(lamp, "auto_clip_start", text="Autoclip Start")
-                       sub = row.row()
-                       sub.active = not lamp.auto_clip_start
-                       sub.itemR(lamp, "shadow_buffer_clip_start", text="Clip Start")
-
-                       row = layout.row()
-                       row.itemR(lamp, "auto_clip_end", text="Autoclip End")
-                       sub = row.row()
-                       sub.active = not lamp.auto_clip_end
-                       sub.itemR(lamp, "shadow_buffer_clip_end", text=" Clip End")
+    bl_label = "Shadow"
+
+    def poll(self, context):
+        lamp = context.lamp
+        return (lamp and lamp.type in ('POINT','SUN', 'SPOT', 'AREA'))
+
+    def draw(self, context):
+        layout = self.layout
+
+        lamp = context.lamp
+
+        layout.itemR(lamp, "shadow_method", expand=True)
+
+        if lamp.shadow_method != 'NOSHADOW':
+            split = layout.split()
+
+            col = split.column()
+            col.itemR(lamp, "shadow_color", text="")
+
+            col = split.column()
+            col.itemR(lamp, "shadow_layer", text="This Layer Only")
+            col.itemR(lamp, "only_shadow")
+
+        if lamp.shadow_method == 'RAY_SHADOW':
+            col = layout.column()
+            col.itemL(text="Sampling:")
+            col.row().itemR(lamp, "shadow_ray_sampling_method", expand=True)
+
+            if lamp.type in ('POINT', 'SUN', 'SPOT'):
+                split = layout.split()
+
+                col = split.column()
+                col.itemR(lamp, "shadow_soft_size", text="Soft Size")
+
+                col.itemR(lamp, "shadow_ray_samples", text="Samples")
+                if lamp.shadow_ray_sampling_method == 'ADAPTIVE_QMC':
+                    col.itemR(lamp, "shadow_adaptive_threshold", text="Threshold")
+                col = split.column()
+
+            elif lamp.type == 'AREA':
+                split = layout.split()
+
+                col = split.column()
+                sub = split.column(align=True)
+                if lamp.shape == 'SQUARE':
+                    col.itemR(lamp, "shadow_ray_samples_x", text="Samples")
+                elif lamp.shape == 'RECTANGLE':
+                    col.itemR(lamp, "shadow_ray_samples_x", text="Samples X")
+                    col.itemR(lamp, "shadow_ray_samples_y", text="Samples Y")
+
+                if lamp.shadow_ray_sampling_method == 'ADAPTIVE_QMC':
+                    col.itemR(lamp, "shadow_adaptive_threshold", text="Threshold")
+
+                elif lamp.shadow_ray_sampling_method == 'CONSTANT_JITTERED':
+                    sub.itemR(lamp, "umbra")
+                    sub.itemR(lamp, "dither")
+                    sub.itemR(lamp, "jitter")
+
+        elif lamp.shadow_method == 'BUFFER_SHADOW':
+            col = layout.column()
+            col.itemL(text="Buffer Type:")
+            col.row().itemR(lamp, "shadow_buffer_type", expand=True)
+
+            if lamp.shadow_buffer_type in ('REGULAR', 'HALFWAY', 'DEEP'):
+                split = layout.split()
+
+                col = split.column()
+                col.itemL(text="Filter Type:")
+                col.itemR(lamp, "shadow_filter_type", text="")
+                sub = col.column(align=True)
+                sub.itemR(lamp, "shadow_buffer_soft", text="Soft")
+                sub.itemR(lamp, "shadow_buffer_bias", text="Bias")
+
+                col = split.column()
+                col.itemL(text="Sample Buffers:")
+                col.itemR(lamp, "shadow_sample_buffers", text="")
+                sub = col.column(align=True)
+                sub.itemR(lamp, "shadow_buffer_size", text="Size")
+                sub.itemR(lamp, "shadow_buffer_samples", text="Samples")
+                if lamp.shadow_buffer_type == 'DEEP':
+                    col.itemR(lamp, "compression_threshold")
+
+            elif lamp.shadow_buffer_type == 'IRREGULAR':
+                layout.itemR(lamp, "shadow_buffer_bias", text="Bias")
+
+            row = layout.row()
+            row.itemR(lamp, "auto_clip_start", text="Autoclip Start")
+            sub = row.row()
+            sub.active = not lamp.auto_clip_start
+            sub.itemR(lamp, "shadow_buffer_clip_start", text="Clip Start")
+
+            row = layout.row()
+            row.itemR(lamp, "auto_clip_end", text="Autoclip End")
+            sub = row.row()
+            sub.active = not lamp.auto_clip_end
+            sub.itemR(lamp, "shadow_buffer_clip_end", text=" Clip End")
 
 class DATA_PT_area(DataButtonsPanel):
-       bl_label = "Area Shape"
-       
-       def poll(self, context):
-               lamp = context.lamp
-               return (lamp and lamp.type == 'AREA')
-
-       def draw(self, context):
-               layout = self.layout
-               
-               lamp = context.lamp
-
-               split = layout.split()
-               
-               col = split.column()
-               col.row().itemR(lamp, "shape", expand=True)
-               
-               sub = col.column(align=True)
-               if (lamp.shape == 'SQUARE'):
-                       sub.itemR(lamp, "size")
-               elif (lamp.shape == 'RECTANGLE'):
-                       sub.itemR(lamp, "size", text="Size X")
-                       sub.itemR(lamp, "size_y", text="Size Y")
+    bl_label = "Area Shape"
+
+    def poll(self, context):
+        lamp = context.lamp
+        return (lamp and lamp.type == 'AREA')
+
+    def draw(self, context):
+        layout = self.layout
+
+        lamp = context.lamp
+
+        split = layout.split()
+
+        col = split.column()
+        col.row().itemR(lamp, "shape", expand=True)
+
+        sub = col.column(align=True)
+        if (lamp.shape == 'SQUARE'):
+            sub.itemR(lamp, "size")
+        elif (lamp.shape == 'RECTANGLE'):
+            sub.itemR(lamp, "size", text="Size X")
+            sub.itemR(lamp, "size_y", text="Size Y")
 
 class DATA_PT_spot(DataButtonsPanel):
-       bl_label = "Spot Shape"
-       
-       def poll(self, context):
-               lamp = context.lamp
-               return (lamp and lamp.type == 'SPOT')
-
-       def draw(self, context):
-               layout = self.layout
-               
-               lamp = context.lamp
-
-               split = layout.split()
-               
-               col = split.column()
-               sub = col.column()
-               sub.itemR(lamp, "spot_size", text="Size")
-               sub.itemR(lamp, "spot_blend", text="Blend", slider=True)
-               col.itemR(lamp, "square")
-               
-               col = split.column()
-               col.itemR(lamp, "halo")
-               sub = col.column(align=True)
-               sub.active = lamp.halo
-               sub.itemR(lamp, "halo_intensity", text="Intensity")
-               if lamp.shadow_method == 'BUFFER_SHADOW':
-                       sub.itemR(lamp, "halo_step", text="Step")
+    bl_label = "Spot Shape"
+
+    def poll(self, context):
+        lamp = context.lamp
+        return (lamp and lamp.type == 'SPOT')
+
+    def draw(self, context):
+        layout = self.layout
+
+        lamp = context.lamp
+
+        split = layout.split()
+
+        col = split.column()
+        sub = col.column()
+        sub.itemR(lamp, "spot_size", text="Size")
+        sub.itemR(lamp, "spot_blend", text="Blend", slider=True)
+        col.itemR(lamp, "square")
+
+        col = split.column()
+        col.itemR(lamp, "halo")
+        sub = col.column(align=True)
+        sub.active = lamp.halo
+        sub.itemR(lamp, "halo_intensity", text="Intensity")
+        if lamp.shadow_method == 'BUFFER_SHADOW':
+            sub.itemR(lamp, "halo_step", text="Step")
 
 class DATA_PT_falloff_curve(DataButtonsPanel):
-       bl_label = "Falloff Curve"
-       bl_default_closed = True
-       
-       def poll(self, context):
-               lamp = context.lamp
+    bl_label = "Falloff Curve"
+    bl_default_closed = True
+
+    def poll(self, context):
+        lamp = context.lamp
 
-               return (lamp and lamp.type in ('POINT', 'SPOT') and lamp.falloff_type == 'CUSTOM_CURVE')
+        return (lamp and lamp.type in ('POINT', 'SPOT') and lamp.falloff_type == 'CUSTOM_CURVE')
 
-       def draw(self, context):
-               lamp = context.lamp
+    def draw(self, context):
+        lamp = context.lamp
 
-               self.layout.template_curve_mapping(lamp, "falloff_curve")
+        self.layout.template_curve_mapping(lamp, "falloff_curve")
 
 bpy.types.register(DATA_PT_context_lamp)
 bpy.types.register(DATA_PT_preview)
index 505ea6e42e9183c78cb576786e589b9ec65c92ef..fa3451ce5e61723f331a0acf181060a31dda224f 100644 (file)
@@ -2,56 +2,56 @@
 import bpy
 
 class DataButtonsPanel(bpy.types.Panel):
-       bl_space_type = 'PROPERTIES'
-       bl_region_type = 'WINDOW'
-       bl_context = "data"
-       
-       def poll(self, context):
-               return context.lattice
-       
+    bl_space_type = 'PROPERTIES'
+    bl_region_type = 'WINDOW'
+    bl_context = "data"
+
+    def poll(self, context):
+        return context.lattice
+
 class DATA_PT_context_lattice(DataButtonsPanel):
-       bl_label = ""
-       bl_show_header = False
-       
-       def draw(self, context):
-               layout = self.layout
-               
-               ob = context.object
-               lat = context.lattice
-               space = context.space_data
-
-               split = layout.split(percentage=0.65)
-
-               if ob:
-                       split.template_ID(ob, "data")
-                       split.itemS()
-               elif lat:
-                       split.template_ID(space, "pin_id")
-                       split.itemS()
+    bl_label = ""
+    bl_show_header = False
+
+    def draw(self, context):
+        layout = self.layout
+
+        ob = context.object
+        lat = context.lattice
+        space = context.space_data
+
+        split = layout.split(percentage=0.65)
+
+        if ob:
+            split.template_ID(ob, "data")
+            split.itemS()
+        elif lat:
+            split.template_ID(space, "pin_id")
+            split.itemS()
 
 class DATA_PT_lattice(DataButtonsPanel):
-       bl_label = "Lattice"
-
-       def draw(self, context):
-               layout = self.layout
-               
-               lat = context.lattice
-
-               row = layout.row()
-               row.itemR(lat, "points_u")
-               row.itemR(lat, "interpolation_type_u", expand=True)
-                       
-               row = layout.row()
-               row.itemR(lat, "points_v")
-               row.itemR(lat, "interpolation_type_v", expand=True)
-                       
-               row = layout.row()
-               row.itemR(lat, "points_w")
-               row.itemR(lat, "interpolation_type_w", expand=True)
-                       
-               row = layout.row()
-               row.itemO("lattice.make_regular")
-               row.itemR(lat, "outside")
+    bl_label = "Lattice"
+
+    def draw(self, context):
+        layout = self.layout
+
+        lat = context.lattice
+
+        row = layout.row()
+        row.itemR(lat, "points_u")
+        row.itemR(lat, "interpolation_type_u", expand=True)
+
+        row = layout.row()
+        row.itemR(lat, "points_v")
+        row.itemR(lat, "interpolation_type_v", expand=True)
+
+        row = layout.row()
+        row.itemR(lat, "points_w")
+        row.itemR(lat, "interpolation_type_w", expand=True)
+
+        row = layout.row()
+        row.itemO("lattice.make_regular")
+        row.itemR(lat, "outside")
 
 bpy.types.register(DATA_PT_context_lattice)
 bpy.types.register(DATA_PT_lattice)
index 2ed52206d7e0366c7a4e021eb8538ee9066053b6..c9141a59bf4c6567f06da460854cbf61cbeaa4b0 100644 (file)
 import bpy
 
 class DataButtonsPanel(bpy.types.Panel):
-       bl_space_type = 'PROPERTIES'
-       bl_region_type = 'WINDOW'
-       bl_context = "data"
-       
-       def poll(self, context):
-               return context.mesh
+    bl_space_type = 'PROPERTIES'
+    bl_region_type = 'WINDOW'
+    bl_context = "data"
+
+    def poll(self, context):
+        return context.mesh
 
 class DATA_PT_context_mesh(DataButtonsPanel):
-       bl_label = ""
-       bl_show_header = False
-       
-       def draw(self, context):
-               layout = self.layout
-               
-               ob = context.object
-               mesh = context.mesh
-               space = context.space_data
-
-               split = layout.split(percentage=0.65)
-
-               if ob:
-                       split.template_ID(ob, "data")
-                       split.itemS()
-               elif mesh:
-                       split.template_ID(space, "pin_id")
-                       split.itemS()
+    bl_label = ""
+    bl_show_header = False
+
+    def draw(self, context):
+        layout = self.layout
+
+        ob = context.object
+        mesh = context.mesh
+        space = context.space_data
+
+        split = layout.split(percentage=0.65)
+
+        if ob:
+            split.template_ID(ob, "data")
+            split.itemS()
+        elif mesh:
+            split.template_ID(space, "pin_id")
+            split.itemS()
 
 class DATA_PT_normals(DataButtonsPanel):
-       bl_label = "Normals"
-
-       def draw(self, context):
-               layout = self.layout
-               
-               mesh = context.mesh
-               
-               split = layout.split()
-               
-               col = split.column()
-               col.itemR(mesh, "autosmooth")
-               sub = col.column()
-               sub.active = mesh.autosmooth
-               sub.itemR(mesh, "autosmooth_angle", text="Angle")
-               
-               col = split.column()
-               col.itemR(mesh, "vertex_normal_flip")
-               col.itemR(mesh, "double_sided")
+    bl_label = "Normals"
+
+    def draw(self, context):
+        layout = self.layout
+
+        mesh = context.mesh
+
+        split = layout.split()
+
+        col = split.column()
+        col.itemR(mesh, "autosmooth")
+        sub = col.column()
+        sub.active = mesh.autosmooth
+        sub.itemR(mesh, "autosmooth_angle", text="Angle")
+
+        col = split.column()
+        col.itemR(mesh, "vertex_normal_flip")
+        col.itemR(mesh, "double_sided")
 
 class DATA_PT_settings(DataButtonsPanel):
-       bl_label = "Settings"
-
-       def draw(self, context):
-               layout = self.layout
-               
-               mesh = context.mesh
-               
-               split = layout.split()
-               
-               col = split.column()
-               col.itemR(mesh, "texture_mesh")
+    bl_label = "Settings"
+
+    def draw(self, context):
+        layout = self.layout
+
+        mesh = context.mesh
+
+        split = layout.split()
+
+        col = split.column()
+        col.itemR(mesh, "texture_mesh")
 
 class DATA_PT_vertex_groups(DataButtonsPanel):
-       bl_label = "Vertex Groups"
-       
-       def poll(self, context):
-               return (context.object and context.object.type in ('MESH', 'LATTICE'))
-
-       def draw(self, context):
-               layout = self.layout
-               
-               ob = context.object
-               group = ob.active_vertex_group
-
-               rows = 2
-               if group:
-                       rows= 5
-
-               row = layout.row()
-               row.template_list(ob, "vertex_groups", ob, "active_vertex_group_index", rows=rows)
-
-               col = row.column(align=True)
-               col.itemO("object.vertex_group_add", icon='ICON_ZOOMIN', text="")
-               col.itemO("object.vertex_group_remove", icon='ICON_ZOOMOUT', text="")
-
-               col.itemO("object.vertex_group_copy", icon='ICON_COPY_ID', text="")
-               if ob.data.users > 1:
-                       col.itemO("object.vertex_group_copy_to_linked", icon='ICON_LINK_AREA', text="")
-
-               if group:
-                       row = layout.row()
-                       row.itemR(group, "name")
-
-               if ob.mode == 'EDIT' and len(ob.vertex_groups) > 0:
-                       row = layout.row()
-                       
-                       sub = row.row(align=True)
-                       sub.itemO("object.vertex_group_assign", text="Assign")
-                       sub.itemO("object.vertex_group_remove_from", text="Remove")
-                       
-                       sub = row.row(align=True)
-                       sub.itemO("object.vertex_group_select", text="Select")
-                       sub.itemO("object.vertex_group_deselect", text="Deselect")
-
-                       layout.itemR(context.tool_settings, "vertex_group_weight", text="Weight")
+    bl_label = "Vertex Groups"
+
+    def poll(self, context):
+        return (context.object and context.object.type in ('MESH', 'LATTICE'))
+
+    def draw(self, context):
+        layout = self.layout
+
+        ob = context.object
+        group = ob.active_vertex_group
+
+        rows = 2
+        if group:
+            rows= 5
+
+        row = layout.row()
+        row.template_list(ob, "vertex_groups", ob, "active_vertex_group_index", rows=rows)
+
+        col = row.column(align=True)
+        col.itemO("object.vertex_group_add", icon='ICON_ZOOMIN', text="")
+        col.itemO("object.vertex_group_remove", icon='ICON_ZOOMOUT', text="")
+
+        col.itemO("object.vertex_group_copy", icon='ICON_COPY_ID', text="")
+        if ob.data.users > 1:
+            col.itemO("object.vertex_group_copy_to_linked", icon='ICON_LINK_AREA', text="")
+
+        if group:
+            row = layout.row()
+            row.itemR(group, "name")
+
+        if ob.mode == 'EDIT' and len(ob.vertex_groups) > 0:
+            row = layout.row()
+
+            sub = row.row(align=True)
+            sub.itemO("object.vertex_group_assign", text="Assign")
+            sub.itemO("object.vertex_group_remove_from", text="Remove")
+
+            sub = row.row(align=True)
+            sub.itemO("object.vertex_group_select", text="Select")
+            sub.itemO("object.vertex_group_deselect", text="Deselect")
+
+            layout.itemR(context.tool_settings, "vertex_group_weight", text="Weight")
 
 class DATA_PT_shape_keys(DataButtonsPanel):
-       bl_label = "Shape Keys"
-       
-       def poll(self, context):
-               return (context.object and context.object.type in ('MESH', 'LATTICE', 'CURVE', 'SURFACE'))
-
-       def draw(self, context):
-               layout = self.layout
-               
-               ob = context.object
-               key = ob.data.shape_keys
-               kb = ob.active_shape_key
-
-               enable_edit = ob.mode != 'EDIT'
-               enable_edit_value = False
-
-               if ob.shape_key_lock == False:
-                       if enable_edit or (ob.type == 'MESH' and ob.shape_key_edit_mode):
-                               enable_edit_value = True
-
-               row = layout.row()
-
-               rows = 2
-               if kb:
-                       rows= 5
-               row.template_list(key, "keys", ob, "active_shape_key_index", rows=rows)
-
-               col = row.column()
-
-               subcol = col.column(align=True)
-               subcol.itemO("object.shape_key_add", icon='ICON_ZOOMIN', text="")
-               subcol.itemO("object.shape_key_remove", icon='ICON_ZOOMOUT', text="")
-
-               if kb:
-                       col.itemS()
-
-                       subcol = col.column(align=True)
-                       subcol.item_enumO("object.shape_key_move", "type", 'UP', icon='ICON_TRIA_UP', text="")
-                       subcol.item_enumO("object.shape_key_move", "type", 'DOWN', icon='ICON_TRIA_DOWN', text="")
-
-                       split = layout.split(percentage=0.4)
-                       sub = split.row()
-                       sub.enabled = enable_edit
-                       sub.itemR(key, "relative")
-
-                       sub = split.row()
-                       sub.alignment = 'RIGHT'
-
-                       subrow = sub.row(align=True)
-                       subrow.active= enable_edit_value
-                       subrow.itemR(ob, "shape_key_lock", icon='ICON_UNPINNED', text="")
-                       subrow.itemR(kb, "mute", icon='ICON_MUTE_IPO_OFF', text="")
-                       subrow.itemO("object.shape_key_clear", icon='ICON_X', text="")
-
-                       sub.itemO("object.shape_key_mirror", icon='ICON_MOD_MIRROR', text="")
-
-                       sub.itemR(ob, "shape_key_edit_mode", text="")
-
-                       row = layout.row()
-                       row.itemR(kb, "name")
-
-                       if key.relative:
-                               if ob.active_shape_key_index != 0:
-                                       row = layout.row()
-                                       row.active = enable_edit_value
-                                       row.itemR(kb, "value")
-                                       
-                                       split = layout.split()
-                                       sub = split.column(align=True)
-                                       sub.active = enable_edit_value
-                                       sub.itemL(text="Range:")
-                                       sub.itemR(kb, "slider_min", text="Min")
-                                       sub.itemR(kb, "slider_max", text="Max")
-                                       
-                                       sub = split.column(align=True)
-                                       sub.active = enable_edit_value
-                                       sub.itemL(text="Blend:")
-                                       sub.item_pointerR(kb, "vertex_group", ob, "vertex_groups", text="")
-                                       sub.item_pointerR(kb, "relative_key", key, "keys", text="")
-                                       
-                       else:
-                               row = layout.row()
-                               row.active = enable_edit_value
-                               row.itemR(key, "slurph")
+    bl_label = "Shape Keys"
+
+    def poll(self, context):
+        return (context.object and context.object.type in ('MESH', 'LATTICE', 'CURVE', 'SURFACE'))
+
+    def draw(self, context):
+        layout = self.layout
+
+        ob = context.object
+        key = ob.data.shape_keys
+        kb = ob.active_shape_key
+
+        enable_edit = ob.mode != 'EDIT'
+        enable_edit_value = False
+
+        if ob.shape_key_lock == False:
+            if enable_edit or (ob.type == 'MESH' and ob.shape_key_edit_mode):
+                enable_edit_value = True
+
+        row = layout.row()
+
+        rows = 2
+        if kb:
+            rows= 5
+        row.template_list(key, "keys", ob, "active_shape_key_index", rows=rows)
+
+        col = row.column()
+
+        subcol = col.column(align=True)
+        subcol.itemO("object.shape_key_add", icon='ICON_ZOOMIN', text="")
+        subcol.itemO("object.shape_key_remove", icon='ICON_ZOOMOUT', text="")
+
+        if kb:
+            col.itemS()
+
+            subcol = col.column(align=True)
+            subcol.item_enumO("object.shape_key_move", "type", 'UP', icon='ICON_TRIA_UP', text="")
+            subcol.item_enumO("object.shape_key_move", "type", 'DOWN', icon='ICON_TRIA_DOWN', text="")
+
+            split = layout.split(percentage=0.4)
+            sub = split.row()
+            sub.enabled = enable_edit
+            sub.itemR(key, "relative")
+
+            sub = split.row()
+            sub.alignment = 'RIGHT'
+
+            subrow = sub.row(align=True)
+            subrow.active= enable_edit_value
+            subrow.itemR(ob, "shape_key_lock", icon='ICON_UNPINNED', text="")
+            subrow.itemR(kb, "mute", icon='ICON_MUTE_IPO_OFF', text="")
+            subrow.itemO("object.shape_key_clear", icon='ICON_X', text="")
+
+            sub.itemO("object.shape_key_mirror", icon='ICON_MOD_MIRROR', text="")
+
+            sub.itemR(ob, "shape_key_edit_mode", text="")
+
+            row = layout.row()
+            row.itemR(kb, "name")
+
+            if key.relative:
+                if ob.active_shape_key_index != 0:
+                    row = layout.row()
+                    row.active = enable_edit_value
+                    row.itemR(kb, "value")
+
+                    split = layout.split()
+                    sub = split.column(align=True)
+                    sub.active = enable_edit_value
+                    sub.itemL(text="Range:")
+                    sub.itemR(kb, "slider_min", text="Min")
+                    sub.itemR(kb, "slider_max", text="Max")
+
+                    sub = split.column(align=True)
+                    sub.active = enable_edit_value
+                    sub.itemL(text="Blend:")
+                    sub.item_pointerR(kb, "vertex_group", ob, "vertex_groups", text="")
+                    sub.item_pointerR(kb, "relative_key", key, "keys", text="")
+
+            else:
+                row = layout.row()
+                row.active = enable_edit_value
+                row.itemR(key, "slurph")
 
 class DATA_PT_uv_texture(DataButtonsPanel):
-       bl_label = "UV Texture"
-       
-       def draw(self, context):
-               layout = self.layout
-               
-               me = context.mesh
-
-               row = layout.row()
-               col = row.column()
-               
-               col.template_list(me, "uv_textures", me, "active_uv_texture_index", rows=2)
-
-               col = row.column(align=True)
-               col.itemO("mesh.uv_texture_add", icon='ICON_ZOOMIN', text="")
-               col.itemO("mesh.uv_texture_remove", icon='ICON_ZOOMOUT', text="")
-
-               lay = me.active_uv_texture
-               if lay:
-                       layout.itemR(lay, "name")
+    bl_label = "UV Texture"
+
+    def draw(self, context):
+        layout = self.layout
+
+        me = context.mesh
+
+        row = layout.row()
+        col = row.column()
+
+        col.template_list(me, "uv_textures", me, "active_uv_texture_index", rows=2)
+
+        col = row.column(align=True)
+        col.itemO("mesh.uv_texture_add", icon='ICON_ZOOMIN', text="")
+        col.itemO("mesh.uv_texture_remove", icon='ICON_ZOOMOUT', text="")
+
+        lay = me.active_uv_texture
+        if lay:
+            layout.itemR(lay, "name")
 
 class DATA_PT_vertex_colors(DataButtonsPanel):
-       bl_label = "Vertex Colors"
-       
-       def draw(self, context):
-               layout = self.layout
-               
-               me = context.mesh
+    bl_label = "Vertex Colors"
+
+    def draw(self, context):
+        layout = self.layout
+
+        me = context.mesh
 
-               row = layout.row()
-               col = row.column()
+        row = layout.row()
+        col = row.column()
 
-               col.template_list(me, "vertex_colors", me, "active_vertex_color_index", rows=2)
+        col.template_list(me, "vertex_colors", me, "active_vertex_color_index", rows=2)
 
-               col = row.column(align=True)
-               col.itemO("mesh.vertex_color_add", icon='ICON_ZOOMIN', text="")
-               col.itemO("mesh.vertex_color_remove", icon='ICON_ZOOMOUT', text="")
+        col = row.column(align=True)
+        col.itemO("mesh.vertex_color_add", icon='ICON_ZOOMIN', text="")
+        col.itemO("mesh.vertex_color_remove", icon='ICON_ZOOMOUT', text="")
 
-               lay = me.active_vertex_color
-               if lay:
-                       layout.itemR(lay, "name")
+        lay = me.active_vertex_color
+        if lay:
+            layout.itemR(lay, "name")
 
 bpy.types.register(DATA_PT_context_mesh)
 bpy.types.register(DATA_PT_normals)
index ebb5efb40cab459ed99ba8a237d8b01e5d6c63f5..8176041e1cc0a5e7807e3829440eebb76c6014c8 100644 (file)
 import bpy
 
 class DataButtonsPanel(bpy.types.Panel):
-       bl_space_type = 'PROPERTIES'
-       bl_region_type = 'WINDOW'
-       bl_context = "data"
-       
-       def poll(self, context):
-               return context.meta_ball
+    bl_space_type = 'PROPERTIES'
+    bl_region_type = 'WINDOW'
+    bl_context = "data"
+
+    def poll(self, context):
+        return context.meta_ball
 
 class DATA_PT_context_metaball(DataButtonsPanel):
-       bl_label = ""
-       bl_show_header = False
-       
-       def draw(self, context):
-               layout = self.layout
-               
-               ob = context.object
-               mball = context.meta_ball
-               space = context.space_data
-
-               split = layout.split(percentage=0.65)
-
-               if ob:
-                       split.template_ID(ob, "data")
-                       split.itemS()
-               elif mball:
-                       split.template_ID(space, "pin_id")
-                       split.itemS()
+    bl_label = ""
+    bl_show_header = False
+
+    def draw(self, context):
+        layout = self.layout
+
+        ob = context.object
+        mball = context.meta_ball
+        space = context.space_data
+
+        split = layout.split(percentage=0.65)
+
+        if ob:
+            split.template_ID(ob, "data")
+            split.itemS()
+        elif mball:
+            split.template_ID(space, "pin_id")
+            split.itemS()
 
 class DATA_PT_metaball(DataButtonsPanel):
-       bl_label = "Metaball"
-
-       def draw(self, context):
-               layout = self.layout
-               
-               mball = context.meta_ball
-               
-               split = layout.split()
-               
-               col = split.column()
-               col.itemL(text="Resolution:")
-               sub = col.column(align=True)
-               sub.itemR(mball, "wire_size", text="View")
-               sub.itemR(mball, "render_size", text="Render")  
-               
-               col = split.column()
-               col.itemL(text="Settings:")
-               col.itemR(mball, "threshold", text="Threshold")
-
-               layout.itemL(text="Update:")
-               layout.itemR(mball, "flag", expand=True)
+    bl_label = "Metaball"
+
+    def draw(self, context):
+        layout = self.layout
+
+        mball = context.meta_ball
+
+        split = layout.split()
+
+        col = split.column()
+        col.itemL(text="Resolution:")
+        sub = col.column(align=True)
+        sub.itemR(mball, "wire_size", text="View")
+        sub.itemR(mball, "render_size", text="Render")
+
+        col = split.column()
+        col.itemL(text="Settings:")
+        col.itemR(mball, "threshold", text="Threshold")
+
+        layout.itemL(text="Update:")
+        layout.itemR(mball, "flag", expand=True)
 
 class DATA_PT_metaball_element(DataButtonsPanel):
-       bl_label = "Active Element"
-       
-       def poll(self, context):
-               return (context.meta_ball and context.meta_ball.active_element)
-
-       def draw(self, context):
-               layout = self.layout
-               
-               metaelem = context.meta_ball.active_element
-               
-               split = layout.split(percentage=0.3)
-               split.itemL(text="Type:")       
-               split.itemR(metaelem, "type", text="")
-               
-               split = layout.split()
-                       
-               col = split.column()
-               col.itemL(text="Settings:")
-               col.itemR(metaelem, "stiffness", text="Stiffness")
-               col.itemR(metaelem, "negative", text="Negative")
-               col.itemR(metaelem, "hide", text="Hide")
-               
-               if metaelem.type == 'BALL':
-                       col = split.column(align=True)
-                       
-               elif metaelem.type == 'CUBE':
-                       col = split.column(align=True)
-                       col.itemL(text="Size:") 
-                       col.itemR(metaelem, "size_x", text="X")
-                       col.itemR(metaelem, "size_y", text="Y")
-                       col.itemR(metaelem, "size_z", text="Z")
-                       
-               elif metaelem.type == 'TUBE':
-                       col = split.column(align=True)
-                       col.itemL(text="Size:") 
-                       col.itemR(metaelem, "size_x", text="X")
-                       
-               elif metaelem.type == 'PLANE':
-                       col = split.column(align=True)
-                       col.itemL(text="Size:") 
-                       col.itemR(metaelem, "size_x", text="X")
-                       col.itemR(metaelem, "size_y", text="Y")
-                       
-               elif metaelem.type == 'ELLIPSOID':
-                       col = split.column(align=True)
-                       col.itemL(text="Size:") 
-                       col.itemR(metaelem, "size_x", text="X")
-                       col.itemR(metaelem, "size_y", text="Y")
-                       col.itemR(metaelem, "size_z", text="Z")
+    bl_label = "Active Element"
+
+    def poll(self, context):
+        return (context.meta_ball and context.meta_ball.active_element)
+
+    def draw(self, context):
+        layout = self.layout
+
+        metaelem = context.meta_ball.active_element
+
+        split = layout.split(percentage=0.3)
+        split.itemL(text="Type:")
+        split.itemR(metaelem, "type", text="")
+
+        split = layout.split()
+
+        col = split.column()
+        col.itemL(text="Settings:")
+        col.itemR(metaelem, "stiffness", text="Stiffness")
+        col.itemR(metaelem, "negative", text="Negative")
+        col.itemR(metaelem, "hide", text="Hide")
+
+        if metaelem.type == 'BALL':
+            col = split.column(align=True)
+
+        elif metaelem.type == 'CUBE':
+            col = split.column(align=True)
+            col.itemL(text="Size:")
+            col.itemR(metaelem, "size_x", text="X")
+            col.itemR(metaelem, "size_y", text="Y")
+            col.itemR(metaelem, "size_z", text="Z")
+
+        elif metaelem.type == 'TUBE':
+            col = split.column(align=True)
+            col.itemL(text="Size:")
+            col.itemR(metaelem, "size_x", text="X")
+
+        elif metaelem.type == 'PLANE':
+            col = split.column(align=True)
+            col.itemL(text="Size:")
+            col.itemR(metaelem, "size_x", text="X")
+            col.itemR(metaelem, "size_y", text="Y")
+
+        elif metaelem.type == 'ELLIPSOID':
+            col = split.column(align=True)
+            col.itemL(text="Size:")
+            col.itemR(metaelem, "size_x", text="X")
+            col.itemR(metaelem, "size_y", text="Y")
+            col.itemR(metaelem, "size_z", text="Z")
 
 bpy.types.register(DATA_PT_context_metaball)
 bpy.types.register(DATA_PT_metaball)
index 7a49e84e90642017d62b51b5cac99963c803f5e1..a256d20a314665ca7fe04a46c8c5fd4371c4a801 100644 (file)
 import bpy
 
 class DataButtonsPanel(bpy.types.Panel):
-       bl_space_type = 'PROPERTIES'
-       bl_region_type = 'WINDOW'
-       bl_context = "modifier"
-       
+    bl_space_type = 'PROPERTIES'
+    bl_region_type = 'WINDOW'
+    bl_context = "modifier"
+
 class DATA_PT_modifiers(DataButtonsPanel):
-       bl_label = "Modifiers"
-
-       def draw(self, context):
-               layout = self.layout
-               
-               ob = context.object
-
-               row = layout.row()
-               row.item_menu_enumO("object.modifier_add", "type")
-               row.itemL()
-
-               for md in ob.modifiers:
-                       box = layout.template_modifier(md)
-                       if box:
-                               # match enum type to our functions, avoids a lookup table.
-                               getattr(self, md.type)(box, ob, md)
-       
-       # the mt.type enum is (ab)used for a lookup on function names
-       # ...to avoid lengthy if statements
-       # so each type must have a function here.
-
-       def ARMATURE(self, layout, ob, md):
-               layout.itemR(md, "object")
-               
-               split = layout.split(percentage=0.5)
-               split.itemL(text="Vertex Group:")
-               sub = split.split(percentage=0.7)
-               sub.item_pointerR(md, "vertex_group", ob, "vertex_groups", text="")
-               subsub = sub.row()
-               subsub.active = md.vertex_group
-               subsub.itemR(md, "invert")
-               
-               layout.itemS()
-               
-               split = layout.split()
-
-               col = split.column()
-               col.itemL(text="Bind To:")
-               col.itemR(md, "use_vertex_groups", text="Vertex Groups")
-               col.itemR(md, "use_bone_envelopes", text="Bone Envelopes")
-               
-               col = split.column()
-               col.itemL(text="Deformation:")
-               col.itemR(md, "quaternion")
-               col.itemR(md, "multi_modifier")
-               
-       def ARRAY(self, layout, ob, md):
-               layout.itemR(md, "fit_type")
-               if md.fit_type == 'FIXED_COUNT':
-                       layout.itemR(md, "count")
-               elif md.fit_type == 'FIT_LENGTH':
-                       layout.itemR(md, "length")
-               elif md.fit_type == 'FIT_CURVE':
-                       layout.itemR(md, "curve")
-
-               layout.itemS()
-               
-               split = layout.split()
-               
-               col = split.column()
-               col.itemR(md, "constant_offset")
-               sub = col.column()
-               sub.active = md.constant_offset
-               sub.itemR(md, "constant_offset_displacement", text="")
-
-               col.itemS()
-
-               col.itemR(md, "merge_adjacent_vertices", text="Merge")
-               sub = col.column()
-               sub.active = md.merge_adjacent_vertices
-               sub.itemR(md, "merge_end_vertices", text="First Last")
-               sub.itemR(md, "merge_distance", text="Distance")
-               
-               col = split.column()
-               col.itemR(md, "relative_offset")
-               sub = col.column()
-               sub.active = md.relative_offset
-               sub.itemR(md, "relative_offset_displacement", text="")
-
-               col.itemS()
-
-               col.itemR(md, "add_offset_object")
-               sub = col.column()
-               sub.active = md.add_offset_object
-               sub.itemR(md, "offset_object", text="")
-
-               layout.itemS()
-               
-               col = layout.column()
-               col.itemR(md, "start_cap")
-               col.itemR(md, "end_cap")
-       
-       def BEVEL(self, layout, ob, md):
-               row = layout.row()
-               row.itemR(md, "width")
-               row.itemR(md, "only_vertices")
-               
-               layout.itemL(text="Limit Method:")
-               layout.row().itemR(md, "limit_method", expand=True)
-               if md.limit_method == 'ANGLE':
-                       layout.itemR(md, "angle")
-               elif md.limit_method == 'WEIGHT':
-                       layout.row().itemR(md, "edge_weight_method", expand=True)
-                       
-       def BOOLEAN(self, layout, ob, md):
-               layout.itemR(md, "operation")
-               layout.itemR(md, "object")
-               
-       def BUILD(self, layout, ob, md):
-               split = layout.split()
-               
-               col = split.column()
-               col.itemR(md, "start")
-               col.itemR(md, "length")
-
-               col = split.column()
-               col.itemR(md, "randomize")
-               sub = col.column()
-               sub.active = md.randomize
-               sub.itemR(md, "seed")
-
-       def CAST(self, layout, ob, md):
-               layout.itemR(md, "cast_type")
-               layout.itemR(md, "object")
-               if md.object:
-                       layout.itemR(md, "use_transform")
-               
-               flow = layout.column_flow()
-               flow.itemR(md, "x")
-               flow.itemR(md, "y")
-               flow.itemR(md, "z")
-               flow.itemR(md, "factor")
-               flow.itemR(md, "radius")
-               flow.itemR(md, "size")
-
-               layout.itemR(md, "from_radius")
-               
-               layout.item_pointerR(md, "vertex_group", ob, "vertex_groups")
-               
-       def CLOTH(self, layout, ob, md):
-               layout.itemL(text="See Cloth panel.")
-               
-       def COLLISION(self, layout, ob, md):
-               layout.itemL(text="See Collision panel.")
-               
-       def CURVE(self, layout, ob, md):
-               layout.itemR(md, "object")
-               layout.item_pointerR(md, "vertex_group", ob, "vertex_groups")
-               layout.itemR(md, "deform_axis")
-               
-       def DECIMATE(self, layout, ob, md):
-               layout.itemR(md, "ratio")
-               layout.itemR(md, "face_count")
-               
-       def DISPLACE(self, layout, ob, md):
-               layout.item_pointerR(md, "vertex_group", ob, "vertex_groups")
-               layout.itemR(md, "texture")
-               layout.itemR(md, "midlevel")
-               layout.itemR(md, "strength")
-               layout.itemR(md, "direction")
-               layout.itemR(md, "texture_coordinates")
-               if md.texture_coordinates == 'OBJECT':
-                       layout.itemR(md, "texture_coordinate_object", text="Object")
-               elif md.texture_coordinates == 'UV' and ob.type == 'MESH':
-                       layout.item_pointerR(md, "uv_layer", ob.data, "uv_textures")
-       
-       def EDGE_SPLIT(self, layout, ob, md):
-               split = layout.split()
-               
-               col = split.column()
-               col.itemR(md, "use_edge_angle", text="Edge Angle")
-               sub = col.column()
-               sub.active = md.use_edge_angle
-               sub.itemR(md, "split_angle")
-               
-               col = split.column()
-               col.itemR(md, "use_sharp", text="Sharp Edges")
-               
-       def EXPLODE(self, layout, ob, md):
-               layout.item_pointerR(md, "vertex_group", ob, "vertex_groups")
-               layout.itemR(md, "protect")
-
-               flow = layout.column_flow(2)
-               flow.itemR(md, "split_edges")
-               flow.itemR(md, "unborn")
-               flow.itemR(md, "alive")
-               flow.itemR(md, "dead")
-
-               layout.itemO("object.explode_refresh", text="Refresh");
-               
-       def FLUID_SIMULATION(self, layout, ob, md):
-               layout.itemL(text="See Fluid panel.")
-               
-       def HOOK(self, layout, ob, md):
-               col = layout.column()
-               col.itemR(md, "object")
-               if md.object and md.object.type == 'ARMATURE':
-                       layout.item_pointerR(md, "subtarget", md.object.data, "bones", text="Bone")
-               
-               layout.item_pointerR(md, "vertex_group", ob, "vertex_groups")
-
-               split = layout.split()
-               split.itemR(md, "falloff")
-               split.itemR(md, "force", slider=True)
-
-               layout.itemS()
-
-               row = layout.row()
-               row.itemO("object.hook_reset", text="Reset")
-               row.itemO("object.hook_recenter", text="Recenter")
-
-               if ob.mode == 'EDIT':
-                       row = layout.row()
-                       row.itemO("object.hook_select", text="Select")
-                       row.itemO("object.hook_assign", text="Assign")
-               
-       def LATTICE(self, layout, ob, md):
-               layout.itemR(md, "object")
-               layout.item_pointerR(md, "vertex_group", ob, "vertex_groups")
-               
-       def MASK(self, layout, ob, md):
-               layout.itemR(md, "mode")
-               if md.mode == 'ARMATURE':
-                       layout.itemR(md, "armature")
-               elif md.mode == 'VERTEX_GROUP':
-                       layout.item_pointerR(md, "vertex_group", ob, "vertex_groups")
-               layout.itemR(md, "inverse")
-               
-       def MESH_DEFORM(self, layout, ob, md):
-               layout.itemR(md, "object")
-               layout.item_pointerR(md, "vertex_group", ob, "vertex_groups")
-               layout.itemR(md, "invert")
-
-               layout.itemS()
-               
-               if md.is_bound:
-                       layout.itemO("object.meshdeform_bind", text="Unbind")
-               else:
-                       layout.itemO("object.meshdeform_bind", text="Bind")
-                       row = layout.row()
-                       row.itemR(md, "precision")
-                       row.itemR(md, "dynamic")
-               
-       def MIRROR(self, layout, ob, md):
-               layout.itemR(md, "merge_limit")
-               split = layout.split()
-               
-               col = split.column()
-               col.itemR(md, "x")
-               col.itemR(md, "y")
-               col.itemR(md, "z")
-               
-               col = split.column()
-               col.itemL(text="Textures:")
-               col.itemR(md, "mirror_u")
-               col.itemR(md, "mirror_v")
-               
-               col = split.column()
-               col.itemR(md, "clip", text="Do Clipping")
-               col.itemR(md, "mirror_vertex_groups", text="Vertex Group")
-               
-               layout.itemR(md, "mirror_object")
-               
-       def MULTIRES(self, layout, ob, md):
-               layout.itemR(md, "subdivision_type")
-               
-               row = layout.row()
-               row.itemO("object.multires_subdivide", text="Subdivide")
-               row.itemO("object.multires_higher_levels_delete", text="Delete Higher")
-
-               layout.itemR(md, "level")
-       
-       def PARTICLE_INSTANCE(self, layout, ob, md):
-               layout.itemR(md, "object")
-               layout.itemR(md, "particle_system_number")
-               
-               flow = layout.column_flow()
-               flow.itemR(md, "normal")
-               flow.itemR(md, "children")
-               flow.itemR(md, "size")
-               flow.itemR(md, "path")
-               if md.path:
-                       flow.itemR(md, "keep_shape")
-               flow.itemR(md, "unborn")
-               flow.itemR(md, "alive")
-               flow.itemR(md, "dead")
-               flow.itemL(md, "")
-               if md.path:
-                       flow.itemR(md, "axis", text="")
-               
-               if md.path:
-                       row = layout.row()
-                       row.itemR(md, "position", slider=True)
-                       row.itemR(md, "random_position", text = "Random", slider=True)
-               
-       def PARTICLE_SYSTEM(self, layout, ob, md):
-               layout.itemL(text="See Particle panel.")
-               
-       def SHRINKWRAP(self, layout, ob, md):
-               layout.itemR(md, "target")
-               layout.item_pointerR(md, "vertex_group", ob, "vertex_groups")
-               layout.itemR(md, "offset")
-               layout.itemR(md, "subsurf_levels")
-               layout.itemR(md, "mode")
-               if md.mode == 'PROJECT':
-                       layout.itemR(md, "subsurf_levels")
-                       layout.itemR(md, "auxiliary_target")
-               
-                       row = layout.row()
-                       row.itemR(md, "x")
-                       row.itemR(md, "y")
-                       row.itemR(md, "z")
-               
-                       flow = layout.column_flow()
-                       flow.itemR(md, "negative")
-                       flow.itemR(md, "positive")
-                       flow.itemR(md, "cull_front_faces")
-                       flow.itemR(md, "cull_back_faces")
-               elif md.mode == 'NEAREST_SURFACEPOINT':
-                       layout.itemR(md, "keep_above_surface")
-               
-       def SIMPLE_DEFORM(self, layout, ob, md):
-               layout.itemR(md, "mode")
-               layout.item_pointerR(md, "vertex_group", ob, "vertex_groups")
-               layout.itemR(md, "origin")
-               layout.itemR(md, "relative")
-               layout.itemR(md, "factor")
-               layout.itemR(md, "limits")
-               if md.mode in ('TAPER', 'STRETCH'):
-                       layout.itemR(md, "lock_x_axis")
-                       layout.itemR(md, "lock_y_axis")
-                       
-       def SMOKE(self, layout, ob, md):
-               layout.itemL(text="See Smoke panel.")
-       
-       def SMOOTH(self, layout, ob, md):
-               split = layout.split()
-               
-               col = split.column()
-               col.itemR(md, "x")
-               col.itemR(md, "y")
-               col.itemR(md, "z")
-               
-               col = split.column()
-               col.itemR(md, "factor")
-               col.itemR(md, "repeat")
-               
-               layout.item_pointerR(md, "vertex_group", ob, "vertex_groups")
-               
-       def SOFT_BODY(self, layout, ob, md):
-               layout.itemL(text="See Soft Body panel.")
-       
-       def SUBSURF(self, layout, ob, md):
-               layout.row().itemR(md, "subdivision_type", expand=True)
-               
-               flow = layout.column_flow()
-               flow.itemR(md, "levels", text="Preview")
-               flow.itemR(md, "render_levels", text="Render")
-               flow.itemR(md, "optimal_draw", text="Optimal Display")
-               flow.itemR(md, "subsurf_uv")
-
-       def SURFACE(self, layout, ob, md):
-               layout.itemL(text="See Fields panel.")
-       
-       def UV_PROJECT(self, layout, ob, md):
-               if ob.type == 'MESH':
-                       layout.item_pointerR(md, "uv_layer", ob.data, "uv_textures")
-                       layout.itemR(md, "image")
-                       layout.itemR(md, "override_image")
-
-                       split = layout.split()
-
-                       col = split.column()
-                       col.itemL(text="Aspect Ratio:")
-
-                       sub = col.column(align=True)
-                       sub.itemR(md, "horizontal_aspect_ratio", text="Horizontal")
-                       sub.itemR(md, "vertical_aspect_ratio", text="Vertical")
-
-                       col = split.column()
-                       col.itemL(text="Projectors:")
-
-                       sub = col.column(align=True)
-                       sub.itemR(md, "num_projectors", text="Number")
-                       for proj in md.projectors:
-                               sub.itemR(proj, "object", text="")
-               
-       def WAVE(self, layout, ob, md):
-               split = layout.split()
-               
-               col = split.column()
-               col.itemL(text="Motion:")
-               col.itemR(md, "x")
-               col.itemR(md, "y")
-               col.itemR(md, "cyclic")
-               
-               col = split.column()
-               col.itemR(md, "normals")
-               sub = col.column()
-               sub.active = md.normals
-               sub.itemR(md, "x_normal", text="X")
-               sub.itemR(md, "y_normal", text="Y")
-               sub.itemR(md, "z_normal", text="Z")
-               
-               split = layout.split()
-
-               col = split.column()
-               col.itemL(text="Time:")
-               sub = col.column(align=True)
-               sub.itemR(md, "time_offset", text="Offset")
-               sub.itemR(md, "lifetime", text="Life")
-               col.itemR(md, "damping_time", text="Damping")
-               
-               col = split.column()
-               col.itemL(text="Position:")
-               sub = col.column(align=True)
-               sub.itemR(md, "start_position_x", text="X")
-               sub.itemR(md, "start_position_y", text="Y")
-               col.itemR(md, "falloff_radius", text="Falloff")
-               
-               layout.itemS()
-               
-               layout.itemR(md, "start_position_object")
-               layout.item_pointerR(md, "vertex_group", ob, "vertex_groups")
-               layout.itemR(md, "texture")
-               layout.itemR(md, "texture_coordinates")
-               if md.texture_coordinates == 'MAP_UV' and ob.type == 'MESH':
-                       layout.item_pointerR(md, "uv_layer", ob.data, "uv_textures")
-               elif md.texture_coordinates == 'OBJECT':
-                       layout.itemR(md, "texture_coordinates_object")
-               
-               layout.itemS()
-               
-               flow = layout.column_flow()
-               flow.itemR(md, "speed", slider=True)
-               flow.itemR(md, "height", slider=True)
-               flow.itemR(md, "width", slider=True)
-               flow.itemR(md, "narrowness", slider=True)
+    bl_label = "Modifiers"
+
+    def draw(self, context):
+        layout = self.layout
+
+        ob = context.object
+
+        row = layout.row()
+        row.item_menu_enumO("object.modifier_add", "type")
+        row.itemL()
+
+        for md in ob.modifiers:
+            box = layout.template_modifier(md)
+            if box:
+                # match enum type to our functions, avoids a lookup table.
+                getattr(self, md.type)(box, ob, md)
+
+    # the mt.type enum is (ab)used for a lookup on function names
+    # ...to avoid lengthy if statements
+    # so each type must have a function here.
+
+    def ARMATURE(self, layout, ob, md):
+        layout.itemR(md, "object")
+
+        split = layout.split(percentage=0.5)
+        split.itemL(text="Vertex Group:")
+        sub = split.split(percentage=0.7)
+        sub.item_pointerR(md, "vertex_group", ob, "vertex_groups", text="")
+        subsub = sub.row()
+        subsub.active = md.vertex_group
+        subsub.itemR(md, "invert")
+
+        layout.itemS()
+
+        split = layout.split()
+
+        col = split.column()
+        col.itemL(text="Bind To:")
+        col.itemR(md, "use_vertex_groups", text="Vertex Groups")
+        col.itemR(md, "use_bone_envelopes", text="Bone Envelopes")
+
+        col = split.column()
+        col.itemL(text="Deformation:")
+        col.itemR(md, "quaternion")
+        col.itemR(md, "multi_modifier")
+
+    def ARRAY(self, layout, ob, md):
+        layout.itemR(md, "fit_type")
+        if md.fit_type == 'FIXED_COUNT':
+            layout.itemR(md, "count")
+        elif md.fit_type == 'FIT_LENGTH':
+            layout.itemR(md, "length")
+        elif md.fit_type == 'FIT_CURVE':
+            layout.itemR(md, "curve")
+
+        layout.itemS()
+
+        split = layout.split()
+
+        col = split.column()
+        col.itemR(md, "constant_offset")
+        sub = col.column()
+        sub.active = md.constant_offset
+        sub.itemR(md, "constant_offset_displacement", text="")
+
+        col.itemS()
+
+        col.itemR(md, "merge_adjacent_vertices", text="Merge")
+        sub = col.column()
+        sub.active = md.merge_adjacent_vertices
+        sub.itemR(md, "merge_end_vertices", text="First Last")
+        sub.itemR(md, "merge_distance", text="Distance")
+
+        col = split.column()
+        col.itemR(md, "relative_offset")
+        sub = col.column()
+        sub.active = md.relative_offset
+        sub.itemR(md, "relative_offset_displacement", text="")
+
+        col.itemS()
+
+        col.itemR(md, "add_offset_object")
+        sub = col.column()
+        sub.active = md.add_offset_object
+        sub.itemR(md, "offset_object", text="")
+
+        layout.itemS()
+
+        col = layout.column()
+        col.itemR(md, "start_cap")
+        col.itemR(md, "end_cap")
+
+    def BEVEL(self, layout, ob, md):
+        row = layout.row()
+        row.itemR(md, "width")
+        row.itemR(md, "only_vertices")
+
+        layout.itemL(text="Limit Method:")
+        layout.row().itemR(md, "limit_method", expand=True)
+        if md.limit_method == 'ANGLE':
+            layout.itemR(md, "angle")
+        elif md.limit_method == 'WEIGHT':
+            layout.row().itemR(md, "edge_weight_method", expand=True)
+
+    def BOOLEAN(self, layout, ob, md):
+        layout.itemR(md, "operation")
+        layout.itemR(md, "object")
+
+    def BUILD(self, layout, ob, md):
+        split = layout.split()
+
+        col = split.column()
+        col.itemR(md, "start")
+        col.itemR(md, "length")
+
+        col = split.column()
+        col.itemR(md, "randomize")
+        sub = col.column()
+        sub.active = md.randomize
+        sub.itemR(md, "seed")
+
+    def CAST(self, layout, ob, md):
+        layout.itemR(md, "cast_type")
+        layout.itemR(md, "object")
+        if md.object:
+            layout.itemR(md, "use_transform")
+
+        flow = layout.column_flow()
+        flow.itemR(md, "x")
+        flow.itemR(md, "y")
+        flow.itemR(md, "z")
+        flow.itemR(md, "factor")
+        flow.itemR(md, "radius")
+        flow.itemR(md, "size")
+
+        layout.itemR(md, "from_radius")
+
+        layout.item_pointerR(md, "vertex_group", ob, "vertex_groups")
+
+    def CLOTH(self, layout, ob, md):
+        layout.itemL(text="See Cloth panel.")
+
+    def COLLISION(self, layout, ob, md):
+        layout.itemL(text="See Collision panel.")
+
+    def CURVE(self, layout, ob, md):
+        layout.itemR(md, "object")
+        layout.item_pointerR(md, "vertex_group", ob, "vertex_groups")
+        layout.itemR(md, "deform_axis")
+
+    def DECIMATE(self, layout, ob, md):
+        layout.itemR(md, "ratio")
+        layout.itemR(md, "face_count")
+
+    def DISPLACE(self, layout, ob, md):
+        layout.item_pointerR(md, "vertex_group", ob, "vertex_groups")
+        layout.itemR(md, "texture")
+        layout.itemR(md, "midlevel")
+        layout.itemR(md, "strength")
+        layout.itemR(md, "direction")
+        layout.itemR(md, "texture_coordinates")
+        if md.texture_coordinates == 'OBJECT':
+            layout.itemR(md, "texture_coordinate_object", text="Object")
+        elif md.texture_coordinates == 'UV' and ob.type == 'MESH':
+            layout.item_pointerR(md, "uv_layer", ob.data, "uv_textures")
+
+    def EDGE_SPLIT(self, layout, ob, md):
+        split = layout.split()
+
+        col = split.column()
+        col.itemR(md, "use_edge_angle", text="Edge Angle")
+        sub = col.column()
+        sub.active = md.use_edge_angle
+        sub.itemR(md, "split_angle")
+
+        col = split.column()
+        col.itemR(md, "use_sharp", text="Sharp Edges")
+
+    def EXPLODE(self, layout, ob, md):
+        layout.item_pointerR(md, "vertex_group", ob, "vertex_groups")
+        layout.itemR(md, "protect")
+
+        flow = layout.column_flow(2)
+        flow.itemR(md, "split_edges")
+        flow.itemR(md, "unborn")
+        flow.itemR(md, "alive")
+        flow.itemR(md, "dead")
+
+        layout.itemO("object.explode_refresh", text="Refresh");
+
+    def FLUID_SIMULATION(self, layout, ob, md):
+        layout.itemL(text="See Fluid panel.")
+
+    def HOOK(self, layout, ob, md):
+        col = layout.column()
+        col.itemR(md, "object")
+        if md.object and md.object.type == 'ARMATURE':
+            layout.item_pointerR(md, "subtarget", md.object.data, "bones", text="Bone")
+
+        layout.item_pointerR(md, "vertex_group", ob, "vertex_groups")
+
+        split = layout.split()
+        split.itemR(md, "falloff")
+        split.itemR(md, "force", slider=True)
+
+        layout.itemS()
+
+        row = layout.row()
+        row.itemO("object.hook_reset", text="Reset")
+        row.itemO("object.hook_recenter", text="Recenter")
+
+        if ob.mode == 'EDIT':
+            row = layout.row()
+            row.itemO("object.hook_select", text="Select")
+            row.itemO("object.hook_assign", text="Assign")
+
+    def LATTICE(self, layout, ob, md):
+        layout.itemR(md, "object")
+        layout.item_pointerR(md, "vertex_group", ob, "vertex_groups")
+
+    def MASK(self, layout, ob, md):
+        layout.itemR(md, "mode")
+        if md.mode == 'ARMATURE':
+            layout.itemR(md, "armature")
+        elif md.mode == 'VERTEX_GROUP':
+            layout.item_pointerR(md, "vertex_group", ob, "vertex_groups")
+        layout.itemR(md, "inverse")
+
+    def MESH_DEFORM(self, layout, ob, md):
+        layout.itemR(md, "object")
+        layout.item_pointerR(md, "vertex_group", ob, "vertex_groups")
+        layout.itemR(md, "invert")
+
+        layout.itemS()
+
+        if md.is_bound:
+            layout.itemO("object.meshdeform_bind", text="Unbind")
+        else:
+            layout.itemO("object.meshdeform_bind", text="Bind")
+            row = layout.row()
+            row.itemR(md, "precision")
+            row.itemR(md, "dynamic")
+
+    def MIRROR(self, layout, ob, md):
+        layout.itemR(md, "merge_limit")
+        split = layout.split()
+
+        col = split.column()
+        col.itemR(md, "x")
+        col.itemR(md, "y")
+        col.itemR(md, "z")
+
+        col = split.column()
+        col.itemL(text="Textures:")
+        col.itemR(md, "mirror_u")
+        col.itemR(md, "mirror_v")
+
+        col = split.column()
+        col.itemR(md, "clip", text="Do Clipping")
+        col.itemR(md, "mirror_vertex_groups", text="Vertex Group")
+
+        layout.itemR(md, "mirror_object")
+
+    def MULTIRES(self, layout, ob, md):
+        layout.itemR(md, "subdivision_type")
+
+        row = layout.row()
+        row.itemO("object.multires_subdivide", text="Subdivide")
+        row.itemO("object.multires_higher_levels_delete", text="Delete Higher")
+
+        layout.itemR(md, "level")
+
+    def PARTICLE_INSTANCE(self, layout, ob, md):
+        layout.itemR(md, "object")
+        layout.itemR(md, "particle_system_number")
+
+        flow = layout.column_flow()
+        flow.itemR(md, "normal")
+        flow.itemR(md, "children")
+        flow.itemR(md, "size")
+        flow.itemR(md, "path")
+        if md.path:
+            flow.itemR(md, "keep_shape")
+        flow.itemR(md, "unborn")
+        flow.itemR(md, "alive")
+        flow.itemR(md, "dead")
+        flow.itemL(md, "")
+        if md.path:
+            flow.itemR(md, "axis", text="")
+
+        if md.path:
+            row = layout.row()
+            row.itemR(md, "position", slider=True)
+            row.itemR(md, "random_position", text = "Random", slider=True)
+
+    def PARTICLE_SYSTEM(self, layout, ob, md):
+        layout.itemL(text="See Particle panel.")
+
+    def SHRINKWRAP(self, layout, ob, md):
+        layout.itemR(md, "target")
+        layout.item_pointerR(md, "vertex_group", ob, "vertex_groups")
+        layout.itemR(md, "offset")
+        layout.itemR(md, "subsurf_levels")
+        layout.itemR(md, "mode")
+        if md.mode == 'PROJECT':
+            layout.itemR(md, "subsurf_levels")
+            layout.itemR(md, "auxiliary_target")
+
+            row = layout.row()
+            row.itemR(md, "x")
+            row.itemR(md, "y")
+            row.itemR(md, "z")
+
+            flow = layout.column_flow()
+            flow.itemR(md, "negative")
+            flow.itemR(md, "positive")
+            flow.itemR(md, "cull_front_faces")
+            flow.itemR(md, "cull_back_faces")
+        elif md.mode == 'NEAREST_SURFACEPOINT':
+            layout.itemR(md, "keep_above_surface")
+
+    def SIMPLE_DEFORM(self, layout, ob, md):
+        layout.itemR(md, "mode")
+        layout.item_pointerR(md, "vertex_group", ob, "vertex_groups")
+        layout.itemR(md, "origin")
+        layout.itemR(md, "relative")
+        layout.itemR(md, "factor")
+        layout.itemR(md, "limits")
+        if md.mode in ('TAPER', 'STRETCH'):
+            layout.itemR(md, "lock_x_axis")
+            layout.itemR(md, "lock_y_axis")
+
+    def SMOKE(self, layout, ob, md):
+        layout.itemL(text="See Smoke panel.")
+
+    def SMOOTH(self, layout, ob, md):
+        split = layout.split()
+
+        col = split.column()
+        col.itemR(md, "x")
+        col.itemR(md, "y")
+        col.itemR(md, "z")
+
+        col = split.column()
+        col.itemR(md, "factor")
+        col.itemR(md, "repeat")
+
+        layout.item_pointerR(md, "vertex_group", ob, "vertex_groups")
+
+    def SOFT_BODY(self, layout, ob, md):
+        layout.itemL(text="See Soft Body panel.")
+
+    def SUBSURF(self, layout, ob, md):
+        layout.row().itemR(md, "subdivision_type", expand=True)
+
+        flow = layout.column_flow()
+        flow.itemR(md, "levels", text="Preview")
+        flow.itemR(md, "render_levels", text="Render")
+        flow.itemR(md, "optimal_draw", text="Optimal Display")
+        flow.itemR(md, "subsurf_uv")
+
+    def SURFACE(self, layout, ob, md):
+        layout.itemL(text="See Fields panel.")
+
+    def UV_PROJECT(self, layout, ob, md):
+        if ob.type == 'MESH':
+            layout.item_pointerR(md, "uv_layer", ob.data, "uv_textures")
+            layout.itemR(md, "image")
+            layout.itemR(md, "override_image")
+
+            split = layout.split()
+
+            col = split.column()
+            col.itemL(text="Aspect Ratio:")
+
+            sub = col.column(align=True)
+            sub.itemR(md, "horizontal_aspect_ratio", text="Horizontal")
+            sub.itemR(md, "vertical_aspect_ratio", text="Vertical")
+
+            col = split.column()
+            col.itemL(text="Projectors:")
+
+            sub = col.column(align=True)
+            sub.itemR(md, "num_projectors", text="Number")
+            for proj in md.projectors:
+                sub.itemR(proj, "object", text="")
+
+    def WAVE(self, layout, ob, md):
+        split = layout.split()
+
+        col = split.column()
+        col.itemL(text="Motion:")
+        col.itemR(md, "x")
+        col.itemR(md, "y")
+        col.itemR(md, "cyclic")
+
+        col = split.column()
+        col.itemR(md, "normals")
+        sub = col.column()
+        sub.active = md.normals
+        sub.itemR(md, "x_normal", text="X")
+        sub.itemR(md, "y_normal", text="Y")
+        sub.itemR(md, "z_normal", text="Z")
+
+        split = layout.split()
+
+        col = split.column()
+        col.itemL(text="Time:")
+        sub = col.column(align=True)
+        sub.itemR(md, "time_offset", text="Offset")
+        sub.itemR(md, "lifetime", text="Life")
+        col.itemR(md, "damping_time", text="Damping")
+
+        col = split.column()
+        col.itemL(text="Position:")
+        sub = col.column(align=True)
+        sub.itemR(md, "start_position_x", text="X")
+        sub.itemR(md, "start_position_y", text="Y")
+        col.itemR(md, "falloff_radius", text="Falloff")
+
+        layout.itemS()
+
+        layout.itemR(md, "start_position_object")
+        layout.item_pointerR(md, "vertex_group", ob, "vertex_groups")
+        layout.itemR(md, "texture")
+        layout.itemR(md, "texture_coordinates")
+        if md.texture_coordinates == 'MAP_UV' and ob.type == 'MESH':
+            layout.item_pointerR(md, "uv_layer", ob.data, "uv_textures")
+        elif md.texture_coordinates == 'OBJECT':
+            layout.itemR(md, "texture_coordinates_object")
+
+        layout.itemS()
+
+        flow = layout.column_flow()
+        flow.itemR(md, "speed", slider=True)
+        flow.itemR(md, "height", slider=True)
+        flow.itemR(md, "width", slider=True)
+        flow.itemR(md, "narrowness", slider=True)
 
 bpy.types.register(DATA_PT_modifiers)
index 49847863d7cbbce25b5188d146c75638edd97aa0..873da4ad17debab657943a21e5798e777ee4fb31 100644 (file)
 import bpy
 
 class DataButtonsPanel(bpy.types.Panel):
-       bl_space_type = 'PROPERTIES'
-       bl_region_type = 'WINDOW'
-       bl_context = "data"
-       
-       def poll(self, context):
-               return (context.object and context.object.type == 'TEXT' and context.curve)
+    bl_space_type = 'PROPERTIES'
+    bl_region_type = 'WINDOW'
+    bl_context = "data"
+
+    def poll(self, context):
+        return (context.object and context.object.type == 'TEXT' and context.curve)
 
 class DATA_PT_context_text(DataButtonsPanel):
-       bl_label = ""
-       bl_show_header = False
+    bl_label = ""
+    bl_show_header = False
+
+    def draw(self, context):
+        layout = self.layout
 
-       def draw(self, context):
-               layout = self.layout
-               
-               ob = context.object
-               curve = context.curve
-               space = context.space_data
+        ob = context.object
+        curve = context.curve
+        space = context.space_data
 
-               split = layout.split(percentage=0.65)
+        split = layout.split(percentage=0.65)
 
-               if ob:
-                       split.template_ID(ob, "data")
-                       split.itemS()
-               elif curve:
-                       split.template_ID(space, "pin_id")
-                       split.itemS()
+        if ob:
+            split.template_ID(ob, "data")
+            split.itemS()
+        elif curve:
+            split.template_ID(space, "pin_id")
+            split.itemS()
 
 class DATA_PT_shape_text(DataButtonsPanel):
-       bl_label = "Shape Text"
-
-       def draw(self, context):
-               layout = self.layout
-               
-               ob = context.object
-               curve = context.curve
-               space = context.space_data              
-                                                       
-               split = layout.split()
-               
-               col = split.column()
-               col.itemL(text="Caps:")
-               row = col.row()
-               row .itemR(curve, "front")
-               row .itemR(curve, "back")
-               # col = split.column()
-               col.itemL(text="Textures:")
-               col.itemR(curve, "uv_orco")
-               col.itemR(curve, "auto_texspace")
-                       
-               col = split.column()    
-               col.itemL(text="Resolution:")
-               sub = col.column(align=True)
-               sub.itemR(curve, "resolution_u", text="Preview")
-               sub.itemR(curve, "render_resolution_u", text="Render")
-               
-               # resolution_v is not used for text
-               
-               sub = col.column(align=True)
-               col.itemL(text="Display:")
-               col.itemR(curve, "fast", text="Fast Editing")
+    bl_label = "Shape Text"
+
+    def draw(self, context):
+        layout = self.layout
+
+        ob = context.object
+        curve = context.curve
+        space = context.space_data
+
+        split = layout.split()
+
+        col = split.column()
+        col.itemL(text="Caps:")
+        row = col.row()
+        row .itemR(curve, "front")
+        row .itemR(curve, "back")
+        # col = split.column()
+        col.itemL(text="Textures:")
+        col.itemR(curve, "uv_orco")
+        col.itemR(curve, "auto_texspace")
+
+        col = split.column()
+        col.itemL(text="Resolution:")
+        sub = col.column(align=True)
+        sub.itemR(curve, "resolution_u", text="Preview")
+        sub.itemR(curve, "render_resolution_u", text="Render")
+
+        # resolution_v is not used for text
+
+        sub = col.column(align=True)
+        col.itemL(text="Display:")
+        col.itemR(curve, "fast", text="Fast Editing")
 
 class DATA_PT_geometry_text(DataButtonsPanel):
-       bl_label = "Geometry"
-
-       def draw(self, context):
-               layout = self.layout
-               
-               curve = context.curve
-
-               split = layout.split()
-       
-               col = split.column()
-               col.itemL(text="Modification:")
-               col.itemR(curve, "width")
-               col.itemR(curve, "extrude")
-               col.itemL(text="Taper Object:")
-               col.itemR(curve, "taper_object", text="")
-               
-               col = split.column()
-               col.itemL(text="Bevel:")
-               col.itemR(curve, "bevel_depth", text="Depth")
-               col.itemR(curve, "bevel_resolution", text="Resolution")
-               col.itemL(text="Bevel Object:")
-               col.itemR(curve, "bevel_object", text="")
+    bl_label = "Geometry"
+
+    def draw(self, context):
+        layout = self.layout
+
+        curve = context.curve
+
+        split = layout.split()
+
+        col = split.column()
+        col.itemL(text="Modification:")
+        col.itemR(curve, "width")
+        col.itemR(curve, "extrude")
+        col.itemL(text="Taper Object:")
+        col.itemR(curve, "taper_object", text="")
+
+        col = split.column()
+        col.itemL(text="Bevel:")
+        col.itemR(curve, "bevel_depth", text="Depth")
+        col.itemR(curve, "bevel_resolution", text="Resolution")
+        col.itemL(text="Bevel Object:")
+        col.itemR(curve, "bevel_object", text="")
 
 class DATA_PT_font(DataButtonsPanel):
-       bl_label = "Font"
-
-       def draw(self, context):
-               layout = self.layout
-               
-               text = context.curve
-               char = context.curve.edit_format
-
-               layout.itemR(text, "font")
-               
-               row = layout.row()
-               row.itemR(text, "text_size", text="Size")       
-               row.itemR(text, "shear")
-               
-               split = layout.split()
-               
-               col = split.column()    
-               col.itemL(text="Object Font:")
-               col.itemR(text, "family", text="")
-
-               col = split.column()
-               col.itemL(text="Text on Curve:")
-               col.itemR(text, "text_on_curve", text="")
-               
-               split = layout.split()
-               
-               col = split.column()
-               col.itemL(text="Character:")
-               col.itemR(char, "bold")
-               col.itemR(char, "italic")
-               col.itemR(char, "underline")
+    bl_label = "Font"
+
+    def draw(self, context):
+        layout = self.layout
+
+        text = context.curve
+        char = context.curve.edit_format
+
+        layout.itemR(text, "font")
+
+        row = layout.row()
+        row.itemR(text, "text_size", text="Size")
+        row.itemR(text, "shear")
+
+        split = layout.split()
+
+        col = split.column()
+        col.itemL(text="Object Font:")
+        col.itemR(text, "family", text="")
+
+        col = split.column()
+        col.itemL(text="Text on Curve:")
+        col.itemR(text, "text_on_curve", text="")
+
+        split = layout.split()
+
+        col = split.column()
+        col.itemL(text="Character:")
+        col.itemR(char, "bold")
+        col.itemR(char, "italic")
+        col.itemR(char, "underline")
 #              col.itemR(char, "style")
 #              col.itemR(char, "wrap")
 
-               col = split.column(align=True)
-               col.itemL(text="Underline:")
-               col.itemR(text, "ul_position", text="Position")
-               col.itemR(text, "ul_height", text="Thickness")
+        col = split.column(align=True)
+        col.itemL(text="Underline:")
+        col.itemR(text, "ul_position", text="Position")
+        col.itemR(text, "ul_height", text="Thickness")
 
 class DATA_PT_paragraph(DataButtonsPanel):
-       bl_label = "Paragraph"
+    bl_label = "Paragraph"
 
-       def draw(self, context):
-               layout = self.layout
-               
-               text = context.curve
+    def draw(self, context):
+        layout = self.layout
 
-               layout.itemL(text="Align:")
-               layout.itemR(text, "spacemode", expand=True)
+        text = context.curve
 
-               split = layout.split()
-               
-               col = split.column(align=True)  
-               col.itemL(text="Spacing:")
-               col.itemR(text, "spacing", text="Character")
-               col.itemR(text, "word_spacing", text="Word")
-               col.itemR(text, "line_dist", text="Line")
+        layout.itemL(text="Align:")
+        layout.itemR(text, "spacemode", expand=True)
 
-               col = split.column(align=True)
-               col.itemL(text="Offset:")
-               col.itemR(text, "offset_x", text="X")
-               col.itemR(text, "offset_y", text="Y")
+        split = layout.split()
+
+        col = split.column(align=True)
+        col.itemL(text="Spacing:")
+        col.itemR(text, "spacing", text="Character")
+        col.itemR(text, "word_spacing", text="Word")
+        col.itemR(text, "line_dist", text="Line")
+
+        col = split.column(align=True)
+        col.itemL(text="Offset:")
+        col.itemR(text, "offset_x", text="X")
+        col.itemR(text, "offset_y", text="Y")
 
 class DATA_PT_textboxes(DataButtonsPanel):
-       bl_label = "Text Boxes"
-
-       def draw(self, context):
-               layout = self.layout
-                       
-               text = context.curve
-               
-               for box in text.textboxes:
-                       split = layout.box().split()
-                       
-                       col = split.column(align=True)
-                       col.itemL(text="Dimensions:")
-                       col.itemR(box, "width", text="Width")
-                       col.itemR(box, "height", text="Height")
-               
-                       col = split.column(align=True)  
-                       col.itemL(text="Offset:")
-                       col.itemR(box, "x", text="X")
-                       col.itemR(box, "y", text="Y")
+    bl_label = "Text Boxes"
+
+    def draw(self, context):
+        layout = self.layout
+
+        text = context.curve
+
+        for box in text.textboxes:
+            split = layout.box().split()
+
+            col = split.column(align=True)
+            col.itemL(text="Dimensions:")
+            col.itemR(box, "width", text="Width")
+            col.itemR(box, "height", text="Height")
+
+            col = split.column(align=True)
+            col.itemL(text="Offset:")
+            col.itemR(box, "x", text="X")
+            col.itemR(box, "y", text="Y")
 
 bpy.types.register(DATA_PT_context_text)
-bpy.types.register(DATA_PT_shape_text) 
+bpy.types.register(DATA_PT_shape_text)
 bpy.types.register(DATA_PT_geometry_text)
 bpy.types.register(DATA_PT_font)
 bpy.types.register(DATA_PT_paragraph)
index 775818845150e2197d09e78ee9c8e25513f69eb0..af67512dd3e0e93a8f85675e7fc29cd823bd9ae0 100644 (file)
 
 import bpy
+
 class PhysicsButtonsPanel(bpy.types.Panel):
-       bl_space_type = 'PROPERTIES'
-       bl_region_type = 'WINDOW'
-       bl_context = "physics"
+    bl_space_type = 'PROPERTIES'
+    bl_region_type = 'WINDOW'
+    bl_context = "physics"
 
-       def poll(self, context):
-               ob = context.active_object
-               rd = context.scene.render_data
-               return ob and ob.game and (rd.engine == 'BLENDER_GAME')
+    def poll(self, context):
+        ob = context.active_object
+        rd = context.scene.render_data
+        return ob and ob.game and (rd.engine == 'BLENDER_GAME')
 
 class PHYSICS_PT_game_physics(PhysicsButtonsPanel):
-       bl_label = "Physics"
-
-       def draw(self, context):
-               layout = self.layout
-               
-               ob = context.active_object
-               game = ob.game
-               soft = ob.game.soft_body
-
-               layout.itemR(game, "physics_type")
-               layout.itemS()
-               
-               #if game.physics_type == 'DYNAMIC':
-               if game.physics_type in ('DYNAMIC', 'RIGID_BODY'):
-                       split = layout.split()
-                       
-                       col = split.column()
-                       col.itemR(game, "actor")
-                       col.itemR(game, "ghost")
-                       col.itemR(ob, "restrict_render", text="Invisible") # out of place but useful
-                       
-                       col = split.column()
-                       col.itemR(game, "material_physics")
-                       col.itemR(game, "rotate_from_normal")
-                       col.itemR(game, "no_sleeping")
-                       
-                       layout.itemS()
-                       
-                       split = layout.split()
-                       
-                       col = split.column()
-                       col.itemL(text="Attributes:")
-                       col.itemR(game, "mass")
-                       col.itemR(game, "radius")
-                       col.itemR(game, "form_factor")
-                       
-                       col = split.column()
-                       sub = col.column()
-                       sub.active = (game.physics_type == 'RIGID_BODY')
-                       sub.itemR(game, "anisotropic_friction")
-                       subsub = sub.column()
-                       subsub.active = game.anisotropic_friction
-                       subsub.itemR(game, "friction_coefficients", text="", slider=True)
-                       
-                       split = layout.split()
-                       
-                       col = split.column()
-                       col.itemL(text="Velocity:")
-                       sub = col.column(align=True)
-                       sub.itemR(game, "minimum_velocity", text="Minimum")
-                       sub.itemR(game, "maximum_velocity", text="Maximum")
-                       
-                       col = split.column()
-                       col.itemL(text="Damping:")
-                       sub = col.column(align=True)
-                       sub.itemR(game, "damping", text="Translation", slider=True)
-                       sub.itemR(game, "rotation_damping", text="Rotation", slider=True)
-                       
-                       layout.itemS()
-                       
-                       split = layout.split()
-                       
-                       col = split.column()
-                       col.itemL(text="Lock Translation:")
-                       col.itemR(game, "lock_x_axis", text="X")
-                       col.itemR(game, "lock_y_axis", text="Y")
-                       col.itemR(game, "lock_z_axis", text="Z")
-                       
-                       col = split.column()
-                       col.itemL(text="Lock Rotation:")
-                       col.itemR(game, "lock_x_rot_axis", text="X")
-                       col.itemR(game, "lock_y_rot_axis", text="Y")
-                       col.itemR(game, "lock_z_rot_axis", text="Z")
-               
-               elif game.physics_type == 'SOFT_BODY':
-                       col = layout.column()
-                       col.itemR(game, "actor")
-                       col.itemR(game, "ghost")
-                       col.itemR(ob, "restrict_render", text="Invisible")
-                       
-                       layout.itemS()
-                       
-                       split = layout.split()
-                       
-                       col = split.column()
-                       col.itemL(text="Attributes:")
-                       col.itemR(game, "mass")
-                       col.itemR(soft, "welding")
-                       col.itemR(soft, "position_iterations")
-                       col.itemR(soft, "linstiff", slider=True)
-                       col.itemR(soft, "dynamic_friction", slider=True)
-                       col.itemR(soft, "margin", slider=True)
-                       col.itemR(soft, "bending_const", text="Bending Constraints")
-
-                       col = split.column()
-                       col.itemR(soft, "shape_match")
-                       sub = col.column()
-                       sub.active = soft.shape_match
-                       sub.itemR(soft, "threshold", slider=True)
-                       
-                       col.itemS()
-                       
-                       col.itemL(text="Cluster Collision:")
-                       col.itemR(soft, "cluster_rigid_to_softbody")
-                       col.itemR(soft, "cluster_soft_to_softbody")
-                       sub  = col.column()
-                       sub.active = (soft.cluster_rigid_to_softbody or soft.cluster_soft_to_softbody)
-                       sub.itemR(soft, "cluster_iterations", text="Iterations")
-               
-               elif game.physics_type == 'STATIC':
-                       col = layout.column()
-                       col.itemR(game, "actor")
-                       col.itemR(game, "ghost")
-                       col.itemR(ob, "restrict_render", text="Invisible")
-                       
-               elif game.physics_type in ('SENSOR', 'INVISIBLE', 'NO_COLLISION', 'OCCLUDE'):
-                       layout.itemR(ob, "restrict_render", text="Invisible")
-                       
+    bl_label = "Physics"
+
+    def draw(self, context):
+        layout = self.layout
+
+        ob = context.active_object
+        game = ob.game
+        soft = ob.game.soft_body
+
+        layout.itemR(game, "physics_type")
+        layout.itemS()
+
+        #if game.physics_type == 'DYNAMIC':
+        if game.physics_type in ('DYNAMIC', 'RIGID_BODY'):
+            split = layout.split()
+
+            col = split.column()
+            col.itemR(game, "actor")
+            col.itemR(game, "ghost")
+            col.itemR(ob, "restrict_render", text="Invisible") # out of place but useful
+
+            col = split.column()
+            col.itemR(game, "material_physics")
+            col.itemR(game, "rotate_from_normal")
+            col.itemR(game, "no_sleeping")
+
+            layout.itemS()
+
+            split = layout.split()
+
+            col = split.column()
+            col.itemL(text="Attributes:")
+            col.itemR(game, "mass")
+            col.itemR(game, "radius")
+            col.itemR(game, "form_factor")
+
+            col = split.column()
+            sub = col.column()
+            sub.active = (game.physics_type == 'RIGID_BODY')
+            sub.itemR(game, "anisotropic_friction")
+            subsub = sub.column()
+            subsub.active = game.anisotropic_friction
+            subsub.itemR(game, "friction_coefficients", text="", slider=True)
+
+            split = layout.split()
+
+            col = split.column()
+            col.itemL(text="Velocity:")
+            sub = col.column(align=True)
+            sub.itemR(game, "minimum_velocity", text="Minimum")
+            sub.itemR(game, "maximum_velocity", text="Maximum")
+
+            col = split.column()
+            col.itemL(text="Damping:")
+            sub = col.column(align=True)
+            sub.itemR(game, "damping", text="Translation", slider=True)
+            sub.itemR(game, "rotation_damping", text="Rotation", slider=True)
+
+            layout.itemS()
+
+            split = layout.split()
+
+            col = split.column()
+            col.itemL(text="Lock Translation:")
+            col.itemR(game, "lock_x_axis", text="X")
+            col.itemR(game, "lock_y_axis", text="Y")
+            col.itemR(game, "lock_z_axis", text="Z")
+
+            col = split.column()
+            col.itemL(text="Lock Rotation:")
+            col.itemR(game, "lock_x_rot_axis", text="X")
+            col.itemR(game, "lock_y_rot_axis", text="Y")
+            col.itemR(game, "lock_z_rot_axis", text="Z")
+
+        elif game.physics_type == 'SOFT_BODY':
+            col = layout.column()
+            col.itemR(game, "actor")
+            col.itemR(game, "ghost")
+            col.itemR(ob, "restrict_render", text="Invisible")
+
+            layout.itemS()
+
+            split = layout.split()
+
+            col = split.column()
+            col.itemL(text="Attributes:")
+            col.itemR(game, "mass")
+            col.itemR(soft, "welding")
+            col.itemR(soft, "position_iterations")
+            col.itemR(soft, "linstiff", slider=True)
+            col.itemR(soft, "dynamic_friction", slider=True)
+            col.itemR(soft, "margin", slider=True)
+            col.itemR(soft, "bending_const", text="Bending Constraints")
+
+            col = split.column()
+            col.itemR(soft, "shape_match")
+            sub = col.column()
+            sub.active = soft.shape_match
+            sub.itemR(soft, "threshold", slider=True)
+
+            col.itemS()
+
+            col.itemL(text="Cluster Collision:")
+            col.itemR(soft, "cluster_rigid_to_softbody")
+            col.itemR(soft, "cluster_soft_to_softbody")
+            sub  = col.column()
+            sub.active = (soft.cluster_rigid_to_softbody or soft.cluster_soft_to_softbody)
+            sub.itemR(soft, "cluster_iterations", text="Iterations")
+
+        elif game.physics_type == 'STATIC':
+            col = layout.column()
+            col.itemR(game, "actor")
+            col.itemR(game, "ghost")
+            col.itemR(ob, "restrict_render", text="Invisible")
+
+        elif game.physics_type in ('SENSOR', 'INVISIBLE', 'NO_COLLISION', 'OCCLUDE'):
+            layout.itemR(ob, "restrict_render", text="Invisible")
+
 class PHYSICS_PT_game_collision_bounds(PhysicsButtonsPanel):
-       bl_label = "Collision Bounds"
-
-       def poll(self, context):
-               game = context.object.game
-               rd = context.scene.render_data
-               return (game.physics_type in ('DYNAMIC', 'RIGID_BODY', 'SENSOR', 'SOFT_BODY', 'STATIC')) and (rd.engine == 'BLENDER_GAME')
-
-       def draw_header(self, context):
-               game = context.active_object.game
-
-               self.layout.itemR(game, "use_collision_bounds", text="")
-       
-       def draw(self, context):
-               layout = self.layout
-               
-               game = context.active_object.game
-
-               layout.active = game.use_collision_bounds
-               layout.itemR(game, "collision_bounds", text="Bounds")
-               
-               row = layout.row()
-               row.itemR(game, "collision_compound", text="Compound")
-               row.itemR(game, "collision_margin", text="Margin", slider=True)
+    bl_label = "Collision Bounds"
+
+    def poll(self, context):
+        game = context.object.game
+        rd = context.scene.render_data
+        return (game.physics_type in ('DYNAMIC', 'RIGID_BODY', 'SENSOR', 'SOFT_BODY', 'STATIC')) and (rd.engine == 'BLENDER_GAME')
+
+    def draw_header(self, context):
+        game = context.active_object.game
+
+        self.layout.itemR(game, "use_collision_bounds", text="")
+
+    def draw(self, context):
+        layout = self.layout
+
+        game = context.active_object.game
+
+        layout.active = game.use_collision_bounds
+        layout.itemR(game, "collision_bounds", text="Bounds")
+
+        row = layout.row()
+        row.itemR(game, "collision_compound", text="Compound")
+        row.itemR(game, "collision_margin", text="Margin", slider=True)
 
 bpy.types.register(PHYSICS_PT_game_physics)
 bpy.types.register(PHYSICS_PT_game_collision_bounds)
 
 class RenderButtonsPanel(bpy.types.Panel):
-       bl_space_type = 'PROPERTIES'
-       bl_region_type = 'WINDOW'
-       bl_context = "render"
+    bl_space_type = 'PROPERTIES'
+    bl_region_type = 'WINDOW'
+    bl_context = "render"
 
-       def poll(self, context):
-               rd = context.scene.render_data
-               return (rd.engine == 'BLENDER_GAME')
+    def poll(self, context):
+        rd = context.scene.render_data
+        return (rd.engine == 'BLENDER_GAME')
 
 class RENDER_PT_game(RenderButtonsPanel):
-       bl_label = "Game"
+    bl_label = "Game"
 
-       def draw(self, context):
-               layout = self.layout
+    def draw(self, context):
+        layout = self.layout
 
-               row = layout.row()
-               row.itemO("view3d.game_start", text="Start")
-               row.itemL()
+        row = layout.row()
+        row.itemO("view3d.game_start", text="Start")
+        row.itemL()
 
 class RENDER_PT_game_player(RenderButtonsPanel):
-       bl_label = "Standalone Player"
-
-       def draw(self, context):
-               layout = self.layout
-               
-               gs = context.scene.game_data
-               
-               layout.itemR(gs, "fullscreen")
-
-               split = layout.split()
-               
-               col = split.column()
-               col.itemL(text="Resolution:")
-               sub = col.column(align=True)
-               sub.itemR(gs, "resolution_x", slider=False, text="X")
-               sub.itemR(gs, "resolution_y", slider=False, text="Y")
-
-               col = split.column()
-               col.itemL(text="Quality:")
-               sub = col.column(align=True)
-               sub.itemR(gs, "depth", text="Bit Depth", slider=False)
-               sub.itemR(gs, "frequency", text="FPS", slider=False)
-
-               # framing:
-               col = layout.column()
-               col.itemL(text="Framing:")
-               col.row().itemR(gs, "framing_type", expand=True)
-               if gs.framing_type == 'LETTERBOX':
-                       col.itemR(gs, "framing_color", text="")
+    bl_label = "Standalone Player"
+
+    def draw(self, context):
+        layout = self.layout
+
+        gs = context.scene.game_data
+
+        layout.itemR(gs, "fullscreen")
+
+        split = layout.split()
+
+        col = split.column()
+        col.itemL(text="Resolution:")
+        sub = col.column(align=True)
+        sub.itemR(gs, "resolution_x", slider=False, text="X")
+        sub.itemR(gs, "resolution_y", slider=False, text="Y")
+
+        col = split.column()
+        col.itemL(text="Quality:")
+        sub = col.column(align=True)
+        sub.itemR(gs, "depth", text="Bit Depth", slider=False)
+        sub.itemR(gs, "frequency", text="FPS", slider=False)
+
+        # framing:
+        col = layout.column()
+        col.itemL(text="Framing:")
+        col.row().itemR(gs, "framing_type", expand=True)
+        if gs.framing_type == 'LETTERBOX':
+            col.itemR(gs, "framing_color", text="")
 
 class RENDER_PT_game_stereo(RenderButtonsPanel):
-       bl_label = "Stereo"
-
-       def draw(self, context):
-               layout = self.layout
-               
-               gs = context.scene.game_data
-               stereo_mode = gs.stereo
-
-               # stereo options:
-               layout.itemR(gs, "stereo", expand=True)
-               # stereo:
-               if stereo_mode == 'STEREO':
-                       layout.itemR(gs, "stereo_mode")
-                       layout.itemL(text="To do: Focal Length")
-                       layout.itemL(text="To do: Eye Separation")
-
-               # dome:
-               elif stereo_mode == 'DOME':
-                       layout.itemR(gs, "dome_mode", text="Dome Type")
-
-                       dome_type = gs.dome_mode
-
-                       split=layout.split()
-
-                       if dome_type == 'FISHEYE' or \
-                          dome_type == 'TRUNCATED_REAR' or \
-                          dome_type == 'TRUNCATED_FRONT':
-                               
-                               col=split.column()
-                               col.itemR(gs, "dome_angle", slider=True)
-                               col.itemR(gs, "dome_tilt")
-
-                               col=split.column()
-                               col.itemR(gs, "dome_tesselation", text="Tesselation")
-                               col.itemR(gs, "dome_buffer_resolution", text="Resolution", slider=True)
-
-                       elif dome_type == 'PANORAM_SPH':
-                               col=split.column()
-                               col.itemR(gs, "dome_tesselation", text="Tesselation")
-                               col.itemR(gs, "dome_buffer_resolution", text="Resolution", slider=True)
-
-                       else: # cube map
-                               col=split.column()
-                               col.itemR(gs, "dome_buffer_resolution", text="Resolution", slider=True)
-               
-                       layout.itemR(gs, "dome_text")
+    bl_label = "Stereo"
+
+    def draw(self, context):
+        layout = self.layout
+
+        gs = context.scene.game_data
+        stereo_mode = gs.stereo
+
+        # stereo options:
+        layout.itemR(gs, "stereo", expand=True)
+
+        # stereo:
+        if stereo_mode == 'STEREO':
+            layout.itemR(gs, "stereo_mode")
+            layout.itemL(text="To do: Focal Length")
+            layout.itemL(text="To do: Eye Separation")
+
+        # dome:
+        elif stereo_mode == 'DOME':
+            layout.itemR(gs, "dome_mode", text="Dome Type")
+
+            dome_type = gs.dome_mode
+
+            split=layout.split()
+
+            if dome_type == 'FISHEYE' or \
+               dome_type == 'TRUNCATED_REAR' or \
+               dome_type == 'TRUNCATED_FRONT':
+
+                col=split.column()
+                col.itemR(gs, "dome_angle", slider=True)
+                col.itemR(gs, "dome_tilt")
+
+                col=split.column()
+                col.itemR(gs, "dome_tesselation", text="Tesselation")
+                col.itemR(gs, "dome_buffer_resolution", text="Resolution", slider=True)
+
+            elif dome_type == 'PANORAM_SPH':
+                col=split.column()
+                col.itemR(gs, "dome_tesselation", text="Tesselation")
+                col.itemR(gs, "dome_buffer_resolution", text="Resolution", slider=True)
+
+            else: # cube map
+                col=split.column()
+                col.itemR(gs, "dome_buffer_resolution", text="Resolution", slider=True)
+
+            layout.itemR(gs, "dome_text")
 
 class RENDER_PT_game_shading(RenderButtonsPanel):
-       bl_label = "Shading"
-
-       def draw(self, context):
-               layout = self.layout
-               
-               gs = context.scene.game_data
-               layout.itemR(gs, "material_mode", expand=True)
-               if gs.material_mode == 'GLSL':
-                       split = layout.split()
-
-                       col = split.column()
-                       col.itemR(gs, "glsl_lights", text="Lights")
-                       col.itemR(gs, "glsl_shaders", text="Shaders")
-                       col.itemR(gs, "glsl_shadows", text="Shadows")
-
-                       col = split.column()
-                       col.itemR(gs, "glsl_ramps", text="Ramps")
-                       col.itemR(gs, "glsl_nodes", text="Nodes")
-                       col.itemR(gs, "glsl_extra_textures", text="Extra Textures")
+    bl_label = "Shading"
+
+    def draw(self, context):
+        layout = self.layout
+
+        gs = context.scene.game_data
+        layout.itemR(gs, "material_mode", expand=True)
+
+        if gs.material_mode == 'GLSL':
+            split = layout.split()
+
+            col = split.column()
+            col.itemR(gs, "glsl_lights", text="Lights")
+            col.itemR(gs, "glsl_shaders", text="Shaders")
+            col.itemR(gs, "glsl_shadows", text="Shadows")
+
+            col = split.column()
+            col.itemR(gs, "glsl_ramps", text="Ramps")
+            col.itemR(gs, "glsl_nodes", text="Nodes")
+            col.itemR(gs, "glsl_extra_textures", text="Extra Textures")
 
 class RENDER_PT_game_performance(RenderButtonsPanel):
-       bl_label = "Performance"
-
-       def draw(self, context):
-               layout = self.layout
-               
-               gs = context.scene.game_data
-
-               split = layout.split()
-
-               col = split.column()
-               col.itemL(text="Show:")
-               col.itemR(gs, "show_debug_properties", text="Debug Properties")
-               col.itemR(gs, "show_framerate_profile", text="Framerate and Profile")
-               col.itemR(gs, "show_physics_visualization", text="Physics Visualization")
-               col.itemR(gs, "deprecation_warnings")
-               col = split.column()
-               col.itemL(text="Render:")
-               col.itemR(gs, "all_frames")
-               col.itemR(gs, "display_lists")
-               
+    bl_label = "Performance"
+
+    def draw(self, context):
+        layout = self.layout
+
+        gs = context.scene.game_data
+
+        split = layout.split()
+
+        col = split.column()
+        col.itemL(text="Show:")
+        col.itemR(gs, "show_debug_properties", text="Debug Properties")
+        col.itemR(gs, "show_framerate_profile", text="Framerate and Profile")
+        col.itemR(gs, "show_physics_visualization", text="Physics Visualization")
+        col.itemR(gs, "deprecation_warnings")
+
+        col = split.column()
+        col.itemL(text="Render:")
+        col.itemR(gs, "all_frames")
+        col.itemR(gs, "display_lists")
+
 class RENDER_PT_game_sound(RenderButtonsPanel):
-       bl_label = "Sound"
+    bl_label = "Sound"
 
-       def draw(self, context):
-               layout = self.layout
+    def draw(self, context):
+        layout = self.layout
 
-               scene = context.scene
-               
-               layout.itemR(scene, "distance_model")
-               layout.itemR(scene, "speed_of_sound", text="Speed")
-               layout.itemR(scene, "doppler_factor")
+        scene = context.scene
+
+        layout.itemR(scene, "distance_model")
+        layout.itemR(scene, "speed_of_sound", text="Speed")
+        layout.itemR(scene, "doppler_factor")
 
 bpy.types.register(RENDER_PT_game)
 bpy.types.register(RENDER_PT_game_player)
@@ -321,96 +321,96 @@ bpy.types.register(RENDER_PT_game_performance)
 bpy.types.register(RENDER_PT_game_sound)
 
 class WorldButtonsPanel(bpy.types.Panel):
-       bl_space_type = 'PROPERTIES'
-       bl_region_type = 'WINDOW'
-       bl_context = "world"
+    bl_space_type = 'PROPERTIES'
+    bl_region_type = 'WINDOW'
+    bl_context = "world"
 
-       def poll(self, context):
-               rd = context.scene.render_data
-               return (rd.engine == 'BLENDER_GAME')
+    def poll(self, context):
+        rd = context.scene.render_data
+        return (rd.engine == 'BLENDER_GAME')
 
 class WORLD_PT_game_context_world(WorldButtonsPanel):
-       bl_label = ""
-       bl_show_header = False
+    bl_label = ""
+    bl_show_header = False
+
+    def poll(self, context):
+        rd = context.scene.render_data
+        return (context.scene) and (rd.use_game_engine)
 
-       def poll(self, context):
-               rd = context.scene.render_data
-               return (context.scene) and (rd.use_game_engine)
+    def draw(self, context):
+        layout = self.layout
 
-       def draw(self, context):
-               layout = self.layout
-               
-               scene = context.scene
-               world = context.world
-               space = context.space_data
+        scene = context.scene
+        world = context.world
+        space = context.space_data
 
-               split = layout.split(percentage=0.65)
+        split = layout.split(percentage=0.65)
 
-               if scene:
-                       split.template_ID(scene, "world", new="world.new")
-               elif world:
-                       split.template_ID(space, "pin_id")
+        if scene:
+            split.template_ID(scene, "world", new="world.new")
+        elif world:
+            split.template_ID(space, "pin_id")
 
 class WORLD_PT_game_world(WorldButtonsPanel):
-       bl_label = "World"
+    bl_label = "World"
 
-       def draw(self, context):
-               layout = self.layout
-               
-               world = context.world
+    def draw(self, context):
+        layout = self.layout
 
-               row = layout.row()
-               row.column().itemR(world, "horizon_color")
-               row.column().itemR(world, "ambient_color")
+        world = context.world
 
-               layout.itemR(world.mist, "enabled", text="Mist")
+        row = layout.row()
+        row.column().itemR(world, "horizon_color")
+        row.column().itemR(world, "ambient_color")
 
-               row = layout.column_flow()
-               row.active = world.mist.enabled
-               row.itemR(world.mist, "start")
-               row.itemR(world.mist, "depth")
+        layout.itemR(world.mist, "enabled", text="Mist")
+
+        row = layout.column_flow()
+        row.active = world.mist.enabled
+        row.itemR(world.mist, "start")
+        row.itemR(world.mist, "depth")
 
 class WORLD_PT_game_physics(WorldButtonsPanel):
-       bl_label = "Physics"
-       def draw(self, context):
-               layout = self.layout
-               
-               gs = context.scene.game_data
-               
-               layout.itemR(gs, "physics_engine")
-               if gs.physics_engine != 'NONE':
-                       layout.itemR(gs, "physics_gravity", text="Gravity")
-                       split = layout.split()
-                       
-                       col = split.column()
-                       col.itemL(text="Physics Steps:")
-                       sub = col.column(align=True)
-                       sub.itemR(gs, "physics_step_max", text="Max")
-                       sub.itemR(gs, "physics_step_sub", text="Substeps")
-                       col.itemR(gs, "fps", text="FPS")
-                       
-                       col = split.column()
-                       col.itemL(text="Logic Steps:")
-                       col.itemR(gs, "logic_step_max", text="Max")
-                       
-                       col = layout.column()
-                       col.itemR(gs, "use_occlusion_culling", text="Occlusion Culling")
-                       sub = col.column()
-                       sub.active = gs.use_occlusion_culling
-                       sub.itemR(gs, "occlusion_culling_resolution", text="Resolution")
-
-               else:
-                       split = layout.split()
-                       
-                       col = split.column()
-                       col.itemL(text="Physics Steps:")
-                       col.itemR(gs, "fps", text="FPS")
-                       
-                       col = split.column()
-                       col.itemL(text="Logic Steps:")
-                       col.itemR(gs, "logic_step_max", text="Max")
+    bl_label = "Physics"
+
+    def draw(self, context):
+        layout = self.layout
+
+        gs = context.scene.game_data
+
+        layout.itemR(gs, "physics_engine")
+        if gs.physics_engine != 'NONE':
+            layout.itemR(gs, "physics_gravity", text="Gravity")
+
+            split = layout.split()
+
+            col = split.column()
+            col.itemL(text="Physics Steps:")
+            sub = col.column(align=True)
+            sub.itemR(gs, "physics_step_max", text="Max")
+            sub.itemR(gs, "physics_step_sub", text="Substeps")
+            col.itemR(gs, "fps", text="FPS")
+
+            col = split.column()
+            col.itemL(text="Logic Steps:")
+            col.itemR(gs, "logic_step_max", text="Max")
+
+            col = layout.column()
+            col.itemR(gs, "use_occlusion_culling", text="Occlusion Culling")
+            sub = col.column()
+            sub.active = gs.use_occlusion_culling
+            sub.itemR(gs, "occlusion_culling_resolution", text="Resolution")
+
+        else:
+            split = layout.split()
+
+            col = split.column()
+            col.itemL(text="Physics Steps:")
+            col.itemR(gs, "fps", text="FPS")
+
+            col = split.column()
+            col.itemL(text="Logic Steps:")
+            col.itemR(gs, "logic_step_max", text="Max")
 
 bpy.types.register(WORLD_PT_game_context_world)
 bpy.types.register(WORLD_PT_game_world)
index af95eec9a6848060c581d4ab48237435e35e32c6..9131b5284f762768236501a64650b98d31e84ae2 100644 (file)
-       
+
 import bpy
 
 def active_node_mat(mat):
-       # TODO, 2.4x has a pipeline section, for 2.5 we need to communicate
-       # which settings from node-materials are used
-       if mat:
-               mat_node = mat.active_node_material
-               if mat_node:
-                       return mat_node
-               else:
-                       return mat
+    # TODO, 2.4x has a pipeline section, for 2.5 we need to communicate
+    # which settings from node-materials are used
+    if mat:
+        mat_node = mat.active_node_material
+        if mat_node:
+            return mat_node
+        else:
+            return mat
 
-       return None
+    return None
 
 class MaterialButtonsPanel(bpy.types.Panel):
-       bl_space_type = 'PROPERTIES'
-       bl_region_type = 'WINDOW'
-       bl_context = "material"
-       # COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here
+    bl_space_type = 'PROPERTIES'
+    bl_region_type = 'WINDOW'
+    bl_context = "material"
+    # COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here
 
-       def poll(self, context):
-               mat = context.material
-               engine = context.scene.render_data.engine
-               return mat and (engine in self.COMPAT_ENGINES)
+    def poll(self, context):
+        mat = context.material
+        engine = context.scene.render_data.engine
+        return mat and (engine in self.COMPAT_ENGINES)
 
 class MATERIAL_PT_preview(MaterialButtonsPanel):
-       bl_label = "Preview"
-       COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME'])
+    bl_label = "Preview"
+    COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME'])
+
+    def draw(self, context):
+        self.layout.template_preview(context.material)
 
-       def draw(self, context):
-               self.layout.template_preview(context.material)
-               
 class MATERIAL_PT_context_material(MaterialButtonsPanel):
-       bl_label = ""
-       bl_show_header = False
-       COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME'])
-
-       def poll(self, context):
-               # An exception, dont call the parent poll func because
-               # this manages materials for all engine types
-               
-               engine = context.scene.render_data.engine
-               return (context.material or context.object) and (engine in self.COMPAT_ENGINES)
-
-       def draw(self, context):
-               layout = self.layout
-               
-               mat = context.material
-               ob = context.object
-               slot = context.material_slot
-               space = context.space_data
-
-               if ob:
-                       row = layout.row()
-
-                       row.template_list(ob, "materials", ob, "active_material_index", rows=2)
-
-                       col = row.column(align=True)
-                       col.itemO("object.material_slot_add", icon='ICON_ZOOMIN', text="")
-                       col.itemO("object.material_slot_remove", icon='ICON_ZOOMOUT', text="")
-                       col.itemO("object.material_slot_copy", icon='ICON_COPY_ID', text="")
-
-                       if ob.mode == 'EDIT':
-                               row = layout.row(align=True)
-                               row.itemO("object.material_slot_assign", text="Assign")
-                               row.itemO("object.material_slot_select", text="Select")
-                               row.itemO("object.material_slot_deselect", text="Deselect")
-
-               split = layout.split(percentage=0.65)
-
-               if ob:
-                       split.template_ID(ob, "active_material", new="material.new")
-                       row = split.row()
-                       if slot:
-                               row.itemR(slot, "link", text="")
-                       else:
-                               row.itemL()
-               elif mat:
-                       split.template_ID(space, "pin_id")
-                       split.itemS()
-               
-               if mat:
-                       layout.itemR(mat, "type", expand=True)
-       
+    bl_label = ""
+    bl_show_header = False
+    COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME'])
+
+    def poll(self, context):
+        # An exception, dont call the parent poll func because
+        # this manages materials for all engine types
+
+        engine = context.scene.render_data.engine
+        return (context.material or context.object) and (engine in self.COMPAT_ENGINES)
+
+    def draw(self, context):
+        layout = self.layout
+
+        mat = context.material
+        ob = context.object
+        slot = context.material_slot
+        space = context.space_data
+
+        if ob:
+            row = layout.row()
+
+            row.template_list(ob, "materials", ob, "active_material_index", rows=2)
+
+            col = row.column(align=True)
+            col.itemO("object.material_slot_add", icon='ICON_ZOOMIN', text="")
+            col.itemO("object.material_slot_remove", icon='ICON_ZOOMOUT', text="")
+            col.itemO("object.material_slot_copy", icon='ICON_COPY_ID', text="")
+
+            if ob.mode == 'EDIT':
+                row = layout.row(align=True)
+                row.itemO("object.material_slot_assign", text="Assign")
+                row.itemO("object.material_slot_select", text="Select")
+                row.itemO("object.material_slot_deselect", text="Deselect")
+
+        split = layout.split(percentage=0.65)
+
+        if ob:
+            split.template_ID(ob, "active_material", new="material.new")
+            row = split.row()
+            if slot:
+                row.itemR(slot, "link", text="")
+            else:
+                row.itemL()
+        elif mat:
+            split.template_ID(space, "pin_id")
+            split.itemS()
+
+        if mat:
+            layout.itemR(mat, "type", expand=True)
+
 class MATERIAL_PT_shading(MaterialButtonsPanel):
-       bl_label = "Shading"
-       COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME'])
-
-       def poll(self, context):
-               mat = active_node_mat(context.material)
-               engine = context.scene.render_data.engine
-               return mat and (mat.type in ('SURFACE', 'WIRE', 'HALO')) and (engine in self.COMPAT_ENGINES)
-
-       def draw(self, context):
-               layout = self.layout
-               
-               mat = active_node_mat(context.material)
-
-               if mat.type in ('SURFACE', 'WIRE'):
-                       split = layout.split()
-       
-                       col = split.column()
-                       sub = col.column()
-                       sub.active = not mat.shadeless
-                       sub.itemR(mat, "emit")
-                       sub.itemR(mat, "ambient")
-                       sub = col.column()
-                       sub.itemR(mat, "translucency")
-                               
-                       col = split.column()
-                       col.itemR(mat, "shadeless")     
-                       sub = col.column()
-                       sub.active = not mat.shadeless
-                       sub.itemR(mat, "tangent_shading")
-                       sub.itemR(mat, "cubic")
-                               
-               elif mat.type == 'HALO':
-                       layout.itemR(mat, "alpha")
-                       
+    bl_label = "Shading"
+    COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME'])
+
+    def poll(self, context):
+        mat = active_node_mat(context.material)
+        engine = context.scene.render_data.engine
+        return mat and (mat.type in ('SURFACE', 'WIRE', 'HALO')) and (engine in self.COMPAT_ENGINES)
+
+    def draw(self, context):
+        layout = self.layout
+
+        mat = active_node_mat(context.material)
+
+        if mat.type in ('SURFACE', 'WIRE'):
+            split = layout.split()
+
+            col = split.column()
+            sub = col.column()
+            sub.active = not mat.shadeless
+            sub.itemR(mat, "emit")
+            sub.itemR(mat, "ambient")
+            sub = col.column()
+            sub.itemR(mat, "translucency")
+
+            col = split.column()
+            col.itemR(mat, "shadeless")
+            sub = col.column()
+            sub.active = not mat.shadeless
+            sub.itemR(mat, "tangent_shading")
+            sub.itemR(mat, "cubic")
+
+        elif mat.type == 'HALO':
+            layout.itemR(mat, "alpha")
+
 class MATERIAL_PT_strand(MaterialButtonsPanel):
-       bl_label = "Strand"
-       bl_default_closed = True
-       COMPAT_ENGINES = set(['BLENDER_RENDER'])
-
-       def poll(self, context):
-               mat = context.material
-               engine = context.scene.render_data.engine
-               return mat and (mat.type in ('SURFACE', 'WIRE', 'HALO')) and (engine in self.COMPAT_ENGINES)
-       
-       def draw(self, context):
-               layout = self.layout
-               
-               mat = context.material # dont use node material
-               tan = mat.strand
-               
-               split = layout.split()
-               
-               col = split.column(align=True)
-               col.itemL(text="Size:")
-               col.itemR(tan, "root_size", text="Root")
-               col.itemR(tan, "tip_size", text="Tip")
-               col.itemR(tan, "min_size", text="Minimum")
-               col.itemR(tan, "blender_units")
-               sub = col.column()
-               sub.active = (not mat.shadeless)
-               sub.itemR(tan, "tangent_shading")
-               col.itemR(tan, "shape")
-               
-               col = split.column()
-               col.itemL(text="Shading:")
-               col.itemR(tan, "width_fade")
-               ob = context.object
-               if ob and ob.type == 'MESH': col.item_pointerR(tan, "uv_layer", ob.data, "uv_textures", text="")
-               else: col.itemR(tan, "uv_layer", text="")
-               col.itemS()
-               sub = col.column()
-               sub.active = (not mat.shadeless)
-               sub.itemR(tan, "surface_diffuse")
-               sub = col.column()
-               sub.active = tan.surface_diffuse
-               sub.itemR(tan, "blend_distance", text="Distance")
-               
+    bl_label = "Strand"
+    bl_default_closed = True
+    COMPAT_ENGINES = set(['BLENDER_RENDER'])
+
+    def poll(self, context):
+        mat = context.material
+        engine = context.scene.render_data.engine
+        return mat and (mat.type in ('SURFACE', 'WIRE', 'HALO')) and (engine in self.COMPAT_ENGINES)
+
+    def draw(self, context):
+        layout = self.layout
+
+        mat = context.material # dont use node material
+        tan = mat.strand
+
+        split = layout.split()
+
+        col = split.column(align=True)
+        col.itemL(text="Size:")
+        col.itemR(tan, "root_size", text="Root")
+        col.itemR(tan, "tip_size", text="Tip")
+        col.itemR(tan, "min_size", text="Minimum")
+        col.itemR(tan, "blender_units")
+        sub = col.column()
+        sub.active = (not mat.shadeless)
+        sub.itemR(tan, "tangent_shading")
+        col.itemR(tan, "shape")
+
+        col = split.column()
+        col.itemL(text="Shading:")
+        col.itemR(tan, "width_fade")
+        ob = context.object
+        if ob and ob.type == 'MESH': col.item_pointerR(tan, "uv_layer", ob.data, "uv_textures", text="")
+        else: col.itemR(tan, "uv_layer", text="")
+        col.itemS()
+        sub = col.column()
+        sub.active = (not mat.shadeless)
+        sub.itemR(tan, "surface_diffuse")
+        sub = col.column()
+        sub.active = tan.surface_diffuse
+        sub.itemR(tan, "blend_distance", text="Distance")
+
 class MATERIAL_PT_physics(MaterialButtonsPanel):
-       bl_label = "Physics"
-       COMPAT_ENGINES = set(['BLENDER_GAME'])
-       
-       def draw(self, context):
-               layout = self.layout
-               
-               phys = context.material.physics # dont use node material
-               
-               split = layout.split()
-               
-               col = split.column()
-               col.itemR(phys, "distance")
-               col.itemR(phys, "friction")
-               col.itemR(phys, "align_to_normal")
-               
-               col = split.column()
-               col.itemR(phys, "force", slider=True)
-               col.itemR(phys, "elasticity", slider=True)
-               col.itemR(phys, "damp", slider=True)
-               
+    bl_label = "Physics"
+    COMPAT_ENGINES = set(['BLENDER_GAME'])
+
+    def draw(self, context):
+        layout = self.layout
+
+        phys = context.material.physics # dont use node material
+
+        split = layout.split()
+
+        col = split.column()
+        col.itemR(phys, "distance")
+        col.itemR(phys, "friction")
+        col.itemR(phys, "align_to_normal")
+
+        col = split.column()
+        col.itemR(phys, "force", slider=True)
+        col.itemR(phys, "elasticity", slider=True)
+        col.itemR(phys, "damp", slider=True)
+
 class MATERIAL_PT_options(MaterialButtonsPanel):
-       bl_label = "Options"
-       COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME'])
-
-       def poll(self, context):
-               mat = active_node_mat(context.material)
-               engine = context.scene.render_data.engine
-               return mat and (mat.type in ('SURFACE', 'WIRE', 'HALO')) and (engine in self.COMPAT_ENGINES)
-
-       def draw(self, context):
-               layout = self.layout
-               
-               mat = active_node_mat(context.material)
-               
-               split = layout.split()
-               
-               col = split.column()
-               col.itemR(mat, "traceable")
-               col.itemR(mat, "full_oversampling")
-               col.itemR(mat, "sky")
-               col.itemR(mat, "exclude_mist")
-               col.itemR(mat, "invert_z")
-               sub = col.row()
-               sub.itemR(mat, "z_offset")
-               sub.active = mat.transparency and mat.transparency_method == 'Z_TRANSPARENCY'
-               sub = col.column(align=True)
-               sub.itemL(text="Light Group:")
-               sub.itemR(mat, "light_group", text="")
-               row = sub.row()
-               row.active = mat.light_group
-               row.itemR(mat, "light_group_exclusive", text="Exclusive")
-
-               col = split.column()
-               col.itemR(mat, "face_texture")
-               sub = col.column()
-               sub.active = mat.face_texture
-               sub.itemR(mat, "face_texture_alpha")
-               col.itemS()
-               col.itemR(mat, "vertex_color_paint")
-               col.itemR(mat, "vertex_color_light")
-               col.itemR(mat, "object_color")
+    bl_label = "Options"
+    COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME'])
+
+    def poll(self, context):
+        mat = active_node_mat(context.material)
+        engine = context.scene.render_data.engine
+        return mat and (mat.type in ('SURFACE', 'WIRE', 'HALO')) and (engine in self.COMPAT_ENGINES)
+
+    def draw(self, context):
+        layout = self.layout
+
+        mat = active_node_mat(context.material)
+
+        split = layout.split()
+
+        col = split.column()
+        col.itemR(mat, "traceable")
+        col.itemR(mat, "full_oversampling")
+        col.itemR(mat, "sky")
+        col.itemR(mat, "exclude_mist")
+        col.itemR(mat, "invert_z")
+        sub = col.row()
+        sub.itemR(mat, "z_offset")
+        sub.active = mat.transparency and mat.transparency_method == 'Z_TRANSPARENCY'
+        sub = col.column(align=True)
+        sub.itemL(text="Light Group:")
+        sub.itemR(mat, "light_group", text="")
+        row = sub.row()
+        row.active = mat.light_group
+        row.itemR(mat, "light_group_exclusive", text="Exclusive")
+
+        col = split.column()
+        col.itemR(mat, "face_texture")
+        sub = col.column()
+        sub.active = mat.face_texture
+        sub.itemR(mat, "face_texture_alpha")
+        col.itemS()
+        col.itemR(mat, "vertex_color_paint")
+        col.itemR(mat, "vertex_color_light")
+        col.itemR(mat, "object_color")
 
 class MATERIAL_PT_shadow(MaterialButtonsPanel):
-       bl_label = "Shadow"
-       bl_default_closed = True
-       COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME'])
-       
-       def poll(self, context):
-               mat = active_node_mat(context.material)
-               engine = context.scene.render_data.engine
-               return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES)
-
-       def draw(self, context):
-               layout = self.layout
-               
-               mat = active_node_mat(context.material)
-               
-               split = layout.split()
-               
-               col = split.column()
-               col.itemR(mat, "shadows", text="Receive")
-               col.itemR(mat, "receive_transparent_shadows", text="Receive Transparent")
-               col.itemR(mat, "only_shadow", text="Shadows Only")
-               col.itemR(mat, "cast_shadows_only", text="Cast Only")
-               col.itemR(mat, "shadow_casting_alpha", text="Casting Alpha")
-               
-               col = split.column()
-               col.itemR(mat, "cast_buffer_shadows")
-               sub = col.column()
-               sub.active = mat.cast_buffer_shadows
-               sub.itemR(mat, "shadow_buffer_bias", text="Buffer Bias")
-               col.itemR(mat, "ray_shadow_bias", text="Auto Ray Bias")
-               sub = col.column()
-               sub.active = (not mat.ray_shadow_bias)
-               sub.itemR(mat, "shadow_ray_bias", text="Ray Bias")
+    bl_label = "Shadow"
+    bl_default_closed = True
+    COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME'])
+
+    def poll(self, context):
+        mat = active_node_mat(context.material)
+        engine = context.scene.render_data.engine
+        return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES)
+
+    def draw(self, context):
+        layout = self.layout
+
+        mat = active_node_mat(context.material)
+
+        split = layout.split()
+
+        col = split.column()
+        col.itemR(mat, "shadows", text="Receive")
+        col.itemR(mat, "receive_transparent_shadows", text="Receive Transparent")
+        col.itemR(mat, "only_shadow", text="Shadows Only")
+        col.itemR(mat, "cast_shadows_only", text="Cast Only")
+        col.itemR(mat, "shadow_casting_alpha", text="Casting Alpha")
+
+        col = split.column()
+        col.itemR(mat, "cast_buffer_shadows")
+        sub = col.column()
+        sub.active = mat.cast_buffer_shadows
+        sub.itemR(mat, "shadow_buffer_bias", text="Buffer Bias")
+        col.itemR(mat, "ray_shadow_bias", text="Auto Ray Bias")
+        sub = col.column()
+        sub.active = (not mat.ray_shadow_bias)
+        sub.itemR(mat, "shadow_ray_bias", text="Ray Bias")
 
 class MATERIAL_PT_diffuse(MaterialButtonsPanel):
-       bl_label = "Diffuse"
-       COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME'])
-
-       def poll(self, context):
-               mat = active_node_mat(context.material)
-               engine = context.scene.render_data.engine
-               return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES)
-
-       def draw(self, context):
-               layout = self.layout
-               
-               mat = active_node_mat(context.material)
-               
-               split = layout.split()
-               
-               col = split.column()
-               col.itemR(mat, "diffuse_color", text="")
-               sub = col.column()
-               sub.active = (not mat.shadeless)
-               sub.itemR(mat, "diffuse_intensity", text="Intensity")
-               
-               col = split.column()
-               col.active = (not mat.shadeless)
-               col.itemR(mat, "diffuse_shader", text="")
-               col.itemR(mat, "use_diffuse_ramp", text="Ramp")
-               
-               col = layout.column()
-               col.active = (not mat.shadeless)
-               if mat.diffuse_shader == 'OREN_NAYAR':
-                       col.itemR(mat, "roughness")
-               elif mat.diffuse_shader == 'MINNAERT':
-                       col.itemR(mat, "darkness")
-               elif mat.diffuse_shader == 'TOON':
-                       row = col.row()
-                       row.itemR(mat, "diffuse_toon_size", text="Size")
-                       row.itemR(mat, "diffuse_toon_smooth", text="Smooth")
-               elif mat.diffuse_shader == 'FRESNEL':
-                       row = col.row()
-                       row.itemR(mat, "diffuse_fresnel", text="Fresnel")
-                       row.itemR(mat, "diffuse_fresnel_factor", text="Factor")
-                       
-               if mat.use_diffuse_ramp:
-                       layout.itemS()
-                       layout.template_color_ramp(mat, "diffuse_ramp", expand=True)
-                       layout.itemS()
-                       row = layout.row()
-                       split = row.split(percentage=0.3)
-                       split.itemL(text="Input:")
-                       split.itemR(mat, "diffuse_ramp_input", text="")
-                       split = row.split(percentage=0.3)
-                       split.itemL(text="Blend:")
-                       split.itemR(mat, "diffuse_ramp_blend", text="")
-                       row = layout.row()
-                       row.itemR(mat, "diffuse_ramp_factor", text="Factor")
+    bl_label = "Diffuse"
+    COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME'])
+
+    def poll(self, context):
+        mat = active_node_mat(context.material)
+        engine = context.scene.render_data.engine
+        return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES)
+
+    def draw(self, context):
+        layout = self.layout
+
+        mat = active_node_mat(context.material)
+
+        split = layout.split()
+
+        col = split.column()
+        col.itemR(mat, "diffuse_color", text="")
+        sub = col.column()
+        sub.active = (not mat.shadeless)
+        sub.itemR(mat, "diffuse_intensity", text="Intensity")
+
+        col = split.column()
+        col.active = (not mat.shadeless)
+        col.itemR(mat, "diffuse_shader", text="")
+        col.itemR(mat, "use_diffuse_ramp", text="Ramp")
+
+        col = layout.column()
+        col.active = (not mat.shadeless)
+        if mat.diffuse_shader == 'OREN_NAYAR':
+            col.itemR(mat, "roughness")
+        elif mat.diffuse_shader == 'MINNAERT':
+            col.itemR(mat, "darkness")
+        elif mat.diffuse_shader == 'TOON':
+            row = col.row()
+            row.itemR(mat, "diffuse_toon_size", text="Size")
+            row.itemR(mat, "diffuse_toon_smooth", text="Smooth")
+        elif mat.diffuse_shader == 'FRESNEL':
+            row = col.row()
+            row.itemR(mat, "diffuse_fresnel", text="Fresnel")
+            row.itemR(mat, "diffuse_fresnel_factor", text="Factor")
+
+        if mat.use_diffuse_ramp:
+            layout.itemS()
+            layout.template_color_ramp(mat, "diffuse_ramp", expand=True)
+            layout.itemS()
+            row = layout.row()
+            split = row.split(percentage=0.3)
+            split.itemL(text="Input:")
+            split.itemR(mat, "diffuse_ramp_input", text="")
+            split = row.split(percentage=0.3)
+            split.itemL(text="Blend:")
+            split.itemR(mat, "diffuse_ramp_blend", text="")
+            row = layout.row()
+            row.itemR(mat, "diffuse_ramp_factor", text="Factor")
 
 class MATERIAL_PT_specular(MaterialButtonsPanel):
-       bl_label = "Specular"
-       COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME'])
-
-       def poll(self, context):
-               mat = active_node_mat(context.material)
-               engine = context.scene.render_data.engine
-               return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES)
-
-       def draw(self, context):
-               layout = self.layout
-               
-               mat = active_node_mat(context.material)
-               
-               layout.active = (not mat.shadeless)
-               
-               split = layout.split()
-               
-               col = split.column()
-               col.itemR(mat, "specular_color", text="")
-               col.itemR(mat, "specular_intensity", text="Intensity")
-
-               col = split.column()
-               col.itemR(mat, "specular_shader", text="")
-               col.itemR(mat, "use_specular_ramp", text="Ramp")
-
-               col = layout.column()
-               if mat.specular_shader in ('COOKTORR', 'PHONG'):
-                       col.itemR(mat, "specular_hardness", text="Hardness")
-               elif mat.specular_shader == 'BLINN':
-                       row = col.row()
-                       row.itemR(mat, "specular_hardness", text="Hardness")
-                       row.itemR(mat, "specular_ior", text="IOR")
-               elif mat.specular_shader == 'WARDISO':
-                       col.itemR(mat, "specular_slope", text="Slope")
-               elif mat.specular_shader == 'TOON':
-                       row = col.row()
-                       row.itemR(mat, "specular_toon_size", text="Size")
-                       row.itemR(mat, "specular_toon_smooth", text="Smooth")
-               
-               if mat.use_specular_ramp:
-                       layout.itemS()
-                       layout.template_color_ramp(mat, "specular_ramp", expand=True)
-                       layout.itemS()
-                       row = layout.row()
-                       split = row.split(percentage=0.3)
-                       split.itemL(text="Input:")
-                       split.itemR(mat, "specular_ramp_input", text="")
-                       split = row.split(percentage=0.3)
-                       split.itemL(text="Blend:")
-                       split.itemR(mat, "specular_ramp_blend", text="")
-                       row = layout.row()
-                       row.itemR(mat, "specular_ramp_factor", text="Factor")
-               
+    bl_label = "Specular"
+    COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME'])
+
+    def poll(self, context):
+        mat = active_node_mat(context.material)
+        engine = context.scene.render_data.engine
+        return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES)
+
+    def draw(self, context):
+        layout = self.layout
+
+        mat = active_node_mat(context.material)
+
+        layout.active = (not mat.shadeless)
+
+        split = layout.split()
+
+        col = split.column()
+        col.itemR(mat, "specular_color", text="")
+        col.itemR(mat, "specular_intensity", text="Intensity")
+
+        col = split.column()
+        col.itemR(mat, "specular_shader", text="")
+        col.itemR(mat, "use_specular_ramp", text="Ramp")
+
+        col = layout.column()
+        if mat.specular_shader in ('COOKTORR', 'PHONG'):
+            col.itemR(mat, "specular_hardness", text="Hardness")
+        elif mat.specular_shader == 'BLINN':
+            row = col.row()
+            row.itemR(mat, "specular_hardness", text="Hardness")
+            row.itemR(mat, "specular_ior", text="IOR")
+        elif mat.specular_shader == 'WARDISO':
+            col.itemR(mat, "specular_slope", text="Slope")
+        elif mat.specular_shader == 'TOON':
+            row = col.row()
+            row.itemR(mat, "specular_toon_size", text="Size")
+            row.itemR(mat, "specular_toon_smooth", text="Smooth")
+
+        if mat.use_specular_ramp:
+            layout.itemS()
+            layout.template_color_ramp(mat, "specular_ramp", expand=True)
+            layout.itemS()
+            row = layout.row()
+            split = row.split(percentage=0.3)
+            split.itemL(text="Input:")
+            split.itemR(mat, "specular_ramp_input", text="")
+            split = row.split(percentage=0.3)
+            split.itemL(text="Blend:")
+            split.itemR(mat, "specular_ramp_blend", text="")
+            row = layout.row()
+            row.itemR(mat, "specular_ramp_factor", text="Factor")
+
 class MATERIAL_PT_sss(MaterialButtonsPanel):
-       bl_label = "Subsurface Scattering"
-       bl_default_closed = True
-       COMPAT_ENGINES = set(['BLENDER_RENDER'])
-       
-       def poll(self, context):
-               mat = active_node_mat(context.material)
-               engine = context.scene.render_data.engine
-               return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES)
-
-       def draw_header(self, context):
-               mat = active_node_mat(context.material)
-               sss = mat.subsurface_scattering
-               
-               self.layout.active = (not mat.shadeless)
-               self.layout.itemR(sss, "enabled", text="")
-       
-       def draw(self, context):
-               layout = self.layout
-               
-               mat = active_node_mat(context.material)
-               sss = mat.subsurface_scattering
-
-               layout.active = sss.enabled     
-               
-               split = layout.split()
-               split.active = (not mat.shadeless)
-               
-               col = split.column()
-               col.itemR(sss, "ior")
-               col.itemR(sss, "scale")
-               col.itemR(sss, "color", text="")
-               col.itemR(sss, "radius", text="RGB Radius")
-               
-               col = split.column()
-               sub = col.column(align=True)
-               sub.itemL(text="Blend:")
-               sub.itemR(sss, "color_factor", text="Color")
-               sub.itemR(sss, "texture_factor", text="Texture")
-               sub.itemL(text="Scattering Weight:")
-               sub.itemR(sss, "front")
-               sub.itemR(sss, "back")
-               col.itemS()
-               col.itemR(sss, "error_tolerance", text="Error")
+    bl_label = "Subsurface Scattering"
+    bl_default_closed = True
+    COMPAT_ENGINES = set(['BLENDER_RENDER'])
+
+    def poll(self, context):
+        mat = active_node_mat(context.material)
+        engine = context.scene.render_data.engine
+        return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES)
+
+    def draw_header(self, context):
+        mat = active_node_mat(context.material)
+        sss = mat.subsurface_scattering
+
+        self.layout.active = (not mat.shadeless)
+        self.layout.itemR(sss, "enabled", text="")
+
+    def draw(self, context):
+        layout = self.layout
+
+        mat = active_node_mat(context.material)
+        sss = mat.subsurface_scattering
+
+        layout.active = sss.enabled
+
+        split = layout.split()
+        split.active = (not mat.shadeless)
+
+        col = split.column()
+        col.itemR(sss, "ior")
+        col.itemR(sss, "scale")
+        col.itemR(sss, "color", text="")
+        col.itemR(sss, "radius", text="RGB Radius")
+
+        col = split.column()
+        sub = col.column(align=True)
+        sub.itemL(text="Blend:")
+        sub.itemR(sss, "color_factor", text="Color")
+        sub.itemR(sss, "texture_factor", text="Texture")
+        sub.itemL(text="Scattering Weight:")
+        sub.itemR(sss, "front")
+        sub.itemR(sss, "back")
+        col.itemS()
+        col.itemR(sss, "error_tolerance", text="Error")
 
 class MATERIAL_PT_mirror(MaterialButtonsPanel):
-       bl_label = "Mirror"
-       bl_default_closed = True
-       COMPAT_ENGINES = set(['BLENDER_RENDER'])
-       
-       def poll(self, context):
-               mat = active_node_mat(context.material)
-               engine = context.scene.render_data.engine
-               return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES)
-       
-       def draw_header(self, context): 
-               raym = active_node_mat(context.material).raytrace_mirror
-
-               self.layout.itemR(raym, "enabled", text="")
-       
-       def draw(self, context):
-               layout = self.layout
-               
-               mat = active_node_mat(context.material)
-               raym = mat.raytrace_mirror
-               
-               layout.active = raym.enabled
-               
-               split = layout.split()
-               
-               col = split.column()
-               col.itemR(raym, "reflect_factor")
-               col.itemR(mat, "mirror_color", text="")
-
-               col = split.column()
-               col.itemR(raym, "fresnel")
-               sub = col.column()
-               sub.active = raym.fresnel > 0
-               sub.itemR(raym, "fresnel_factor", text="Blend")
-               
-               split = layout.split()
-               
-               col = split.column()
-               col.itemS()
-               col.itemR(raym, "distance", text="Max Dist")
-               col.itemR(raym, "depth")
-               col.itemS()
-               sub = col.split(percentage=0.4)
-               sub.itemL(text="Fade To:")
-               sub.itemR(raym, "fade_to", text="")
-               
-               col = split.column()
-               col.itemL(text="Gloss:")
-               col.itemR(raym, "gloss_factor", text="Amount")
-               sub = col.column()
-               sub.active = raym.gloss_factor < 1.0
-               sub.itemR(raym, "gloss_threshold", text="Threshold")
-               sub.itemR(raym, "gloss_samples", text="Samples")
-               sub.itemR(raym, "gloss_anisotropic", text="Anisotropic")
+    bl_label = "Mirror"
+    bl_default_closed = True
+    COMPAT_ENGINES = set(['BLENDER_RENDER'])
+
+    def poll(self, context):
+        mat = active_node_mat(context.material)
+        engine = context.scene.render_data.engine
+        return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES)
+
+    def draw_header(self, context):
+        raym = active_node_mat(context.material).raytrace_mirror
+
+        self.layout.itemR(raym, "enabled", text="")
+
+    def draw(self, context):
+        layout = self.layout
+
+        mat = active_node_mat(context.material)
+        raym = mat.raytrace_mirror
+
+        layout.active = raym.enabled
+
+        split = layout.split()
+
+        col = split.column()
+        col.itemR(raym, "reflect_factor")
+        col.itemR(mat, "mirror_color", text="")
+
+        col = split.column()
+        col.itemR(raym, "fresnel")
+        sub = col.column()
+        sub.active = raym.fresnel > 0
+        sub.itemR(raym, "fresnel_factor", text="Blend")
+
+        split = layout.split()
+
+        col = split.column()
+        col.itemS()
+        col.itemR(raym, "distance", text="Max Dist")
+        col.itemR(raym, "depth")
+        col.itemS()
+        sub = col.split(percentage=0.4)
+        sub.itemL(text="Fade To:")
+        sub.itemR(raym, "fade_to", text="")
+
+        col = split.column()
+        col.itemL(text="Gloss:")
+        col.itemR(raym, "gloss_factor", text="Amount")
+        sub = col.column()
+        sub.active = raym.gloss_factor < 1.0
+        sub.itemR(raym, "gloss_threshold", text="Threshold")
+        sub.itemR(raym, "gloss_samples", text="Samples")
+        sub.itemR(raym, "gloss_anisotropic", text="Anisotropic")
 
 class MATERIAL_PT_transp(MaterialButtonsPanel):
-       bl_label= "Transparency"
-       bl_default_closed = True
-       COMPAT_ENGINES = set(['BLENDER_RENDER'])
-               
-       def poll(self, context):
-               mat = active_node_mat(context.material)
-               engine = context.scene.render_data.engine
-               return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES)
-
-       def draw_header(self, context): 
-               mat = active_node_mat(context.material)
-
-               self.layout.itemR(mat, "transparency", text="")
-
-       def draw(self, context):
-               layout = self.layout
-               
-               mat = active_node_mat(context.material)
-               rayt = mat.raytrace_transparency
-               
-               row = layout.row()
-               row.active = mat.transparency and (not mat.shadeless)
-               row.itemR(mat, "transparency_method", expand=True)
-               
-               split = layout.split()
-               
-               col = split.column()
-               col.itemR(mat, "alpha")
-               row = col.row()
-               row.active = mat.transparency and (not mat.shadeless)
-               row.itemR(mat, "specular_alpha", text="Specular")
-
-               col = split.column()
-               col.active = (not mat.shadeless)
-               col.itemR(rayt, "fresnel")
-               sub = col.column()
-               sub.active = rayt.fresnel > 0
-               sub.itemR(rayt, "fresnel_factor", text="Blend")
-
-               if mat.transparency_method == 'RAYTRACE':
-                       layout.itemS()
-                       split = layout.split()
-                       split.active = mat.transparency
-
-                       col = split.column()
-                       col.itemR(rayt, "ior")
-                       col.itemR(rayt, "filter")
-                       col.itemR(rayt, "falloff")
-                       col.itemR(rayt, "limit")
-                       col.itemR(rayt, "depth")
-                       
-                       col = split.column()
-                       col.itemL(text="Gloss:")
-                       col.itemR(rayt, "gloss_factor", text="Amount")
-                       sub = col.column()
-                       sub.active = rayt.gloss_factor < 1.0
-                       sub.itemR(rayt, "gloss_threshold", text="Threshold")
-                       sub.itemR(rayt, "gloss_samples", text="Samples")
+    bl_label= "Transparency"
+    bl_default_closed = True
+    COMPAT_ENGINES = set(['BLENDER_RENDER'])
+
+    def poll(self, context):
+        mat = active_node_mat(context.material)
+        engine = context.scene.render_data.engine
+        return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES)
+
+    def draw_header(self, context):
+        mat = active_node_mat(context.material)
+
+        self.layout.itemR(mat, "transparency", text="")
+
+    def draw(self, context):
+        layout = self.layout
+
+        mat = active_node_mat(context.material)
+        rayt = mat.raytrace_transparency
+
+        row = layout.row()
+        row.active = mat.transparency and (not mat.shadeless)
+        row.itemR(mat, "transparency_method", expand=True)
+
+        split = layout.split()
+
+        col = split.column()
+        col.itemR(mat, "alpha")
+        row = col.row()
+        row.active = mat.transparency and (not mat.shadeless)
+        row.itemR(mat, "specular_alpha", text="Specular")
+
+        col = split.column()
+        col.active = (not mat.shadeless)
+        col.itemR(rayt, "fresnel")
+        sub = col.column()
+        sub.active = rayt.fresnel > 0
+        sub.itemR(rayt, "fresnel_factor", text="Blend")
+
+        if mat.transparency_method == 'RAYTRACE':
+            layout.itemS()
+            split = layout.split()
+            split.active = mat.transparency
+
+            col = split.column()
+            col.itemR(rayt, "ior")
+            col.itemR(rayt, "filter")
+            col.itemR(rayt, "falloff")
+            col.itemR(rayt, "limit")
+            col.itemR(rayt, "depth")
+
+            col = split.column()
+            col.itemL(text="Gloss:")
+            col.itemR(rayt, "gloss_factor", text="Amount")
+            sub = col.column()
+            sub.active = rayt.gloss_factor < 1.0
+            sub.itemR(rayt, "gloss_threshold", text="Threshold")
+            sub.itemR(rayt, "gloss_samples", text="Samples")
 
 class MATERIAL_PT_halo(MaterialButtonsPanel):
-       bl_label= "Halo"
-       COMPAT_ENGINES = set(['BLENDER_RENDER'])
-       
-       def poll(self, context):
-               mat = context.material
-               engine = context.scene.render_data.engine
-               return mat and (mat.type == 'HALO') and (engine in self.COMPAT_ENGINES)
-       
-       def draw(self, context):
-               layout = self.layout
-               
-               mat = context.material # dont use node material
-               halo = mat.halo
-
-               split = layout.split()
-               
-               col = split.column()
-               col.itemR(mat, "diffuse_color", text="")
-               col.itemR(halo, "size")
-               col.itemR(halo, "hardness")
-               col.itemR(halo, "add")
-               col.itemL(text="Options:")
-               col.itemR(halo, "texture")
-               col.itemR(halo, "vertex_normal")
-               col.itemR(halo, "xalpha")
-               col.itemR(halo, "shaded")
-               col.itemR(halo, "soft")
-
-               col = split.column()
-               col.itemR(halo, "ring")
-               sub = col.column()
-               sub.active = halo.ring
-               sub.itemR(halo, "rings")
-               sub.itemR(mat, "mirror_color", text="")
-               col.itemS()
-               col.itemR(halo, "lines")
-               sub = col.column()
-               sub.active = halo.lines
-               sub.itemR(halo, "line_number", text="Lines")
-               sub.itemR(mat, "specular_color", text="")
-               col.itemS()
-               col.itemR(halo, "star")
-               sub = col.column()
-               sub.active = halo.star
-               sub.itemR(halo, "star_tips")
-               
+    bl_label= "Halo"
+    COMPAT_ENGINES = set(['BLENDER_RENDER'])
+
+    def poll(self, context):
+        mat = context.material
+        engine = context.scene.render_data.engine
+        return mat and (mat.type == 'HALO') and (engine in self.COMPAT_ENGINES)
+
+    def draw(self, context):
+        layout = self.layout
+
+        mat = context.material # dont use node material
+        halo = mat.halo
+
+        split = layout.split()
+
+        col = split.column()
+        col.itemR(mat, "diffuse_color", text="")
+        col.itemR(halo, "size")
+        col.itemR(halo, "hardness")
+        col.itemR(halo, "add")
+        col.itemL(text="Options:")
+        col.itemR(halo, "texture")
+        col.itemR(halo, "vertex_normal")
+        col.itemR(halo, "xalpha")
+        col.itemR(halo, "shaded")
+        col.itemR(halo, "soft")
+
+        col = split.column()
+        col.itemR(halo, "ring")
+        sub = col.column()
+        sub.active = halo.ring
+        sub.itemR(halo, "rings")
+        sub.itemR(mat, "mirror_color", text="")
+        col.itemS()
+        col.itemR(halo, "lines")
+        sub = col.column()
+        sub.active = halo.lines
+        sub.itemR(halo, "line_number", text="Lines")
+        sub.itemR(mat, "specular_color", text="")
+        col.itemS()
+        col.itemR(halo, "star")
+        sub = col.column()
+        sub.active = halo.star
+        sub.itemR(halo, "star_tips")
+
 class MATERIAL_PT_flare(MaterialButtonsPanel):
-       bl_label= "Flare"
-       COMPAT_ENGINES = set(['BLENDER_RENDER'])
-       
-       def poll(self, context):
-               mat = context.material
-               engine = context.scene.render_data.engine
-               return mat and (mat.type == 'HALO') and (engine in self.COMPAT_ENGINES)
-       
-       def draw_header(self, context):
-               halo = context.material.halo
-
-               self.layout.itemR(halo, "flare_mode", text="")
-       
-       def draw(self, context):
-               layout = self.layout
-               
-               mat = context.material # dont use node material
-               halo = mat.halo
-
-               layout.active = halo.flare_mode
-               
-               split = layout.split()
-               
-               col = split.column()
-               col.itemR(halo, "flare_size", text="Size")
-               col.itemR(halo, "flare_boost", text="Boost")
-               col.itemR(halo, "flare_seed", text="Seed")
-               col = split.column()
-               col.itemR(halo, "flares_sub", text="Subflares")
-               col.itemR(halo, "flare_subsize", text="Subsize")
-               
+    bl_label= "Flare"
+    COMPAT_ENGINES = set(['BLENDER_RENDER'])
+
+    def poll(self, context):
+        mat = context.material
+        engine = context.scene.render_data.engine
+        return mat and (mat.type == 'HALO') and (engine in self.COMPAT_ENGINES)
+
+    def draw_header(self, context):
+        halo = context.material.halo
+
+        self.layout.itemR(halo, "flare_mode", text="")
+
+    def draw(self, context):
+        layout = self.layout
+
+        mat = context.material # dont use node material
+        halo = mat.halo
+
+        layout.active = halo.flare_mode
+
+        split = layout.split()
+
+        col = split.column()
+        col.itemR(halo, "flare_size", text="Size")
+        col.itemR(halo, "flare_boost", text="Boost")
+        col.itemR(halo, "flare_seed", text="Seed")
+        col = split.column()
+        col.itemR(halo, "flares_sub", text="Subflares")
+        col.itemR(halo, "flare_subsize", text="Subsize")
+
 bpy.types.register(MATERIAL_PT_context_material)
 bpy.types.register(MATERIAL_PT_preview)
 bpy.types.register(MATERIAL_PT_diffuse)
@@ -624,122 +624,122 @@ bpy.types.register(MATERIAL_PT_shadow)
 
 # Volumetrics
 class VolumeButtonsPanel(bpy.types.Panel):
-       bl_space_type = 'PROPERTIES'
-       bl_region_type = 'WINDOW'
-       bl_context = "material"
+    bl_space_type = 'PROPERTIES'
+    bl_region_type = 'WINDOW'
+    bl_context = "material"
 
-       def poll(self, context):
-               mat = context.material
-               engine = context.scene.render_data.engine
-               return mat and (mat.type == 'VOLUME') and (engine in self.COMPAT_ENGINES)
+    def poll(self, context):
+        mat = context.material
+        engine = context.scene.render_data.engine
+        return mat and (mat.type == 'VOLUME') and (engine in self.COMPAT_ENGINES)
 
 class MATERIAL_PT_volume_density(VolumeButtonsPanel):
-       bl_label = "Density"
-       bl_default_closed = False
-       COMPAT_ENGINES = set(['BLENDER_RENDER'])
+    bl_label = "Density"
+    bl_default_closed = False
+    COMPAT_ENGINES = set(['BLENDER_RENDER'])
 
-       def draw(self, context):
-               layout = self.layout
+    def draw(self, context):
+        layout = self.layout
 
-               vol = context.material.volume # dont use node material
-               
-               split = layout.split()
-               row = split.row()
-               row.itemR(vol, "density")
-               row.itemR(vol, "density_scale")
+        vol = context.material.volume # dont use node material
+
+        split = layout.split()
+        row = split.row()
+        row.itemR(vol, "density")
+        row.itemR(vol, "density_scale")
 
 class MATERIAL_PT_volume_shading(VolumeButtonsPanel):
-       bl_label = "Shading"
-       bl_default_closed = False
-       COMPAT_ENGINES = set(['BLENDER_RENDER'])
-
-       def draw(self, context):
-               layout = self.layout
-
-               vol = context.material.volume # dont use node material
-               
-               split = layout.split()
-               
-               col = split.column()
-               col.itemR(vol, "scattering")
-               col.itemR(vol, "asymmetry")
-               col.itemR(vol, "transmission_color")
-               
-               col = split.column()
-               sub = col.column(align=True)
-               sub.itemR(vol, "emission")
-               sub.itemR(vol, "emission_color", text="")
-               sub = col.column(align=True)
-               sub.itemR(vol, "reflection")
-               sub.itemR(vol, "reflection_color", text="")     
+    bl_label = "Shading"
+    bl_default_closed = False
+    COMPAT_ENGINES = set(['BLENDER_RENDER'])
+
+    def draw(self, context):
+        layout = self.layout
+
+        vol = context.material.volume # dont use node material
+
+        split = layout.split()
+
+        col = split.column()
+        col.itemR(vol, "scattering")
+        col.itemR(vol, "asymmetry")
+        col.itemR(vol, "transmission_color")
+
+        col = split.column()
+        sub = col.column(align=True)
+        sub.itemR(vol, "emission")
+        sub.itemR(vol, "emission_color", text="")
+        sub = col.column(align=True)
+        sub.itemR(vol, "reflection")
+        sub.itemR(vol, "reflection_color", text="")
 
 class MATERIAL_PT_volume_lighting(VolumeButtonsPanel):
-       bl_label = "Lighting"
-       bl_default_closed = False
-       COMPAT_ENGINES = set(['BLENDER_RENDER'])
-
-       def draw(self, context):
-               layout = self.layout
-               
-               vol = context.material.volume # dont use node material
-               
-               split = layout.split()
-               
-               col = split.column()
-               col.itemR(vol, "lighting_mode", text="")
-               
-               col = split.column()
-               
-               if vol.lighting_mode == 'SHADED':
-                       col.itemR(vol, "external_shadows")
-                       col.itemR(vol, "light_cache")
-                       sub = col.column()
-                       sub.active = vol.light_cache
-                       sub.itemR(vol, "cache_resolution")
-               elif vol.lighting_mode in ('MULTIPLE_SCATTERING', 'SHADED_PLUS_MULTIPLE_SCATTERING'):
-                       sub = col.column()
-                       sub.enabled = True
-                       sub.active = False
-                       sub.itemR(vol, "light_cache")
-                       col.itemR(vol, "cache_resolution")
-                       
-                       sub = col.column(align=True)
-                       sub.itemR(vol, "ms_diffusion")
-                       sub.itemR(vol, "ms_spread")
-                       sub.itemR(vol, "ms_intensity")
+    bl_label = "Lighting"
+    bl_default_closed = False
+    COMPAT_ENGINES = set(['BLENDER_RENDER'])
+
+    def draw(self, context):
+        layout = self.layout
+
+        vol = context.material.volume # dont use node material
+
+        split = layout.split()
+
+        col = split.column()
+        col.itemR(vol, "lighting_mode", text="")
+
+        col = split.column()
+
+        if vol.lighting_mode == 'SHADED':
+            col.itemR(vol, "external_shadows")
+            col.itemR(vol, "light_cache")
+            sub = col.column()
+            sub.active = vol.light_cache
+            sub.itemR(vol, "cache_resolution")
+        elif vol.lighting_mode in ('MULTIPLE_SCATTERING', 'SHADED_PLUS_MULTIPLE_SCATTERING'):
+            sub = col.column()
+            sub.enabled = True
+            sub.active = False
+            sub.itemR(vol, "light_cache")
+            col.itemR(vol, "cache_resolution")
+
+            sub = col.column(align=True)
+            sub.itemR(vol, "ms_diffusion")
+            sub.itemR(vol, "ms_spread")
+            sub.itemR(vol, "ms_intensity")
 
 class MATERIAL_PT_volume_transp(VolumeButtonsPanel):
-       bl_label= "Transparency"
-       COMPAT_ENGINES = set(['BLENDER_RENDER'])
-
-       def draw(self, context):
-               layout = self.layout
-               
-               mat = context.material # dont use node material
-               
-               layout.itemR(mat, "transparency_method", expand=True)
-               
+    bl_label= "Transparency"
+    COMPAT_ENGINES = set(['BLENDER_RENDER'])
+
+    def draw(self, context):
+        layout = self.layout
+
+        mat = context.material # dont use node material
+
+        layout.itemR(mat, "transparency_method", expand=True)
+
 class MATERIAL_PT_volume_integration(VolumeButtonsPanel):
-       bl_label = "Integration"
-       bl_default_closed = False
-       COMPAT_ENGINES = set(['BLENDER_RENDER'])
-
-       def draw(self, context):
-               layout = self.layout
-
-               vol = context.material.volume # dont use node material
-               
-               split = layout.split()
-               
-               col = split.column()
-               col.itemL(text="Step Calculation:")
-               col.itemR(vol, "step_calculation", text="")
-               col = col.column(align=True)
-               col.itemR(vol, "step_size")
-               
-               col = split.column()
-               col.itemL()
-               col.itemR(vol, "depth_cutoff")
+    bl_label = "Integration"
+    bl_default_closed = False
+    COMPAT_ENGINES = set(['BLENDER_RENDER'])
+
+    def draw(self, context):
+        layout = self.layout
+
+        vol = context.material.volume # dont use node material
+
+        split = layout.split()
+
+        col = split.column()
+        col.itemL(text="Step Calculation:")
+        col.itemR(vol, "step_calculation", text="")
+        col = col.column(align=True)
+        col.itemR(vol, "step_size")
+
+        col = split.column()
+        col.itemL()
+        col.itemR(vol, "depth_cutoff")
 
 bpy.types.register(MATERIAL_PT_volume_density)
 bpy.types.register(MATERIAL_PT_volume_shading)
index 213fbf17dd601d6c2a090cf7d86faf340b9f26da..a5705277a6ece7ac59c023f83b9e602f4030b1d7 100644 (file)
 import bpy
 
 class ObjectButtonsPanel(bpy.types.Panel):
-       bl_space_type = 'PROPERTIES'
-       bl_region_type = 'WINDOW'
-       bl_context = "object"
+    bl_space_type = 'PROPERTIES'
+    bl_region_type = 'WINDOW'
+    bl_context = "object"
 
 class OBJECT_PT_context_object(ObjectButtonsPanel):
-       bl_label = ""
-       bl_show_header = False
-
-       def draw(self, context):
-               layout = self.layout
-               
-               ob = context.object
-               
-               row = layout.row()
-               row.itemL(text="", icon='ICON_OBJECT_DATA')
-               row.itemR(ob, "name", text="")
+    bl_label = ""
+    bl_show_header = False
+
+    def draw(self, context):
+        layout = self.layout
+
+        ob = context.object
+
+        row = layout.row()
+        row.itemL(text="", icon='ICON_OBJECT_DATA')
+        row.itemR(ob, "name", text="")
 
 class OBJECT_PT_transform(ObjectButtonsPanel):
-       bl_label = "Transform"
-
-       def draw(self, context):
-               layout = self.layout
-               
-               ob = context.object
-               
-               row = layout.row()
-               
-               row.column().itemR(ob, "location")
-               if ob.rotation_mode == 'QUATERNION':
-                       row.column().itemR(ob, "rotation_quaternion", text="Rotation")
-               elif ob.rotation_mode == 'AXIS_ANGLE':
-                       #row.column().itemL(text="Rotation")
-                       #row.column().itemR(pchan, "rotation_angle", text="Angle")
-                       #row.column().itemR(pchan, "rotation_axis", text="Axis")
-                       row.column().itemR(ob, "rotation_axis_angle", text="Rotation")
-               else:
-                       row.column().itemR(ob, "rotation_euler", text="Rotation")
-                       
-               row.column().itemR(ob, "scale")
-               
-               layout.itemR(ob, "rotation_mode")
-               
+    bl_label = "Transform"
+
+    def draw(self, context):
+        layout = self.layout
+
+        ob = context.object
+
+        row = layout.row()
+
+        row.column().itemR(ob, "location")
+        if ob.rotation_mode == 'QUATERNION':
+            row.column().itemR(ob, "rotation_quaternion", text="Rotation")
+        elif ob.rotation_mode == 'AXIS_ANGLE':
+            #row.column().itemL(text="Rotation")
+            #row.column().itemR(pchan, "rotation_angle", text="Angle")
+            #row.column().itemR(pchan, "rotation_axis", text="Axis")
+            row.column().itemR(ob, "rotation_axis_angle", text="Rotation")
+        else:
+            row.column().itemR(ob, "rotation_euler", text="Rotation")
+
+        row.column().itemR(ob, "scale")
+
+        layout.itemR(ob, "rotation_mode")
+
 class OBJECT_PT_transform_locks(ObjectButtonsPanel):
-       bl_label = "Transform Locks"
-       bl_default_closed = True
-       
-       def draw(self, context):
-               layout = self.layout
-               
-               ob = context.object
-               
-               row = layout.row()
-               
-               col = row.column()
-               col.itemR(ob, "lock_location")
-               
-               col = row.column()
-               if ob.rotation_mode in ('QUATERNION', 'AXIS_ANGLE'):
-                       col.itemR(ob, "lock_rotations_4d", text="Lock Rotation")
-                       if ob.lock_rotations_4d:
-                               col.itemR(ob, "lock_rotation_w", text="W")
-                       col.itemR(ob, "lock_rotation", text="")
-               else:
-                       col.itemR(ob, "lock_rotation", text="Rotation")
-               
-               row.column().itemR(ob, "lock_scale")
+    bl_label = "Transform Locks"
+    bl_default_closed = True
+
+    def draw(self, context):
+        layout = self.layout
+
+        ob = context.object
+
+        row = layout.row()
+
+        col = row.column()
+        col.itemR(ob, "lock_location")
+
+        col = row.column()
+        if ob.rotation_mode in ('QUATERNION', 'AXIS_ANGLE'):
+            col.itemR(ob, "lock_rotations_4d", text="Lock Rotation")
+            if ob.lock_rotations_4d:
+                col.itemR(ob, "lock_rotation_w", text="W")
+            col.itemR(ob, "lock_rotation", text="")
+        else:
+            col.itemR(ob, "lock_rotation", text="Rotation")
+
+        row.column().itemR(ob, "lock_scale")
 
 class OBJECT_PT_relations(ObjectButtonsPanel):
-       bl_label = "Relations"
-
-       def draw(self, context):
-               layout = self.layout
-               
-               ob = context.object
-
-               split = layout.split()
-               
-               col = split.column()
-               col.itemR(ob, "layers")
-               col.itemS()
-               col.itemR(ob, "pass_index")
-
-               col = split.column()
-               col.itemL(text="Parent:")
-               col.itemR(ob, "parent", text="")
-
-               sub = col.column()
-               split = sub.split(percentage=0.3)
-               split.itemL(text="Type:")
-               split.itemR(ob, "parent_type", text="")
-               parent = ob.parent
-               if parent and ob.parent_type == 'BONE' and parent.type == 'ARMATURE':
-                       sub.item_pointerR(ob, "parent_bone", parent.data, "bones", text="")
-               sub.active = parent != None
+    bl_label = "Relations"
+
+    def draw(self, context):
+        layout = self.layout
+
+        ob = context.object
+
+        split = layout.split()
+
+        col = split.column()
+        col.itemR(ob, "layers")
+        col.itemS()
+        col.itemR(ob, "pass_index")
+
+        col = split.column()
+        col.itemL(text="Parent:")
+        col.itemR(ob, "parent", text="")
+
+        sub = col.column()
+        split = sub.split(percentage=0.3)
+        split.itemL(text="Type:")
+        split.itemR(ob, "parent_type", text="")
+        parent = ob.parent
+        if parent and ob.parent_type == 'BONE' and parent.type == 'ARMATURE':
+            sub.item_pointerR(ob, "parent_bone", parent.data, "bones", text="")
+        sub.active = parent != None
 
 class OBJECT_PT_groups(ObjectButtonsPanel):
-       bl_label = "Groups"
+    bl_label = "Groups"
+
+    def draw(self, context):
+        layout = self.layout
 
-       def draw(self, context):
-               layout = self.layout
-               
-               ob = context.object
+        ob = context.object
 
-               split = layout.split()
-               split.item_menu_enumO("object.group_add", "group", text="Add to Group")
-               split.itemL()
+        split = layout.split()
+        split.item_menu_enumO("object.group_add", "group", text="Add to Group")
+        split.itemL()
 
-               for group in bpy.data.groups:
-                       if ob.name in group.objects:
-                               col = layout.column(align=True)
+        for group in bpy.data.groups:
+            if ob.name in group.objects:
+                col = layout.column(align=True)
 
-                               col.set_context_pointer("group", group)
+                col.set_context_pointer("group", group)
 
-                               row = col.box().row()
-                               row.itemR(group, "name", text="")
-                               row.itemO("object.group_remove", text="", icon='VICON_X')
+                row = col.box().row()
+                row.itemR(group, "name", text="")
+                row.itemO("object.group_remove", text="", icon='VICON_X')
 
-                               split = col.box().split()
-                               split.column().itemR(group, "layer", text="Dupli")
-                               split.column().itemR(group, "dupli_offset", text="")
+                split = col.box().split()
+                split.column().itemR(group, "layer", text="Dupli")
+                split.column().itemR(group, "dupli_offset", text="")
 
 class OBJECT_PT_display(ObjectButtonsPanel):
-       bl_label = "Display"
-
-       def draw(self, context):
-