tabs to spaces, remove trailing white space. (apart of pep8)
didnt do "release/scripts/io" since some exporters cant be auto converted
This commit is contained in:
parent
af72bb50ae
commit
f9b19d54b5
@ -27,23 +27,23 @@
|
||||
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")
|
||||
|
||||
|
@ -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]
|
||||
class_obj.getChildren = lambda ob: [child for child in bpy.data.objects if child.parent == ob]
|
||||
|
@ -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="")
|
||||
|
@ -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")
|
||||
|
@ -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
|
||||
|
@ -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()
|
||||
|
@ -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()
|
||||
|
@ -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
|
||||
|
@ -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)
|
||||
'''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"
|
||||
|
||||
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)
|
||||
# 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")
|
||||
bpy.ops.export.some_data(path="/tmp/test.ply")
|
||||
|
@ -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()
|
||||
|
@ -1,180 +1,180 @@
|
||||
|
||||
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
|
||||
bl_label = ""
|
||||
bl_show_header = False
|
||||
|
||||
split = layout.split(percentage=0.65)
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
if ob:
|
||||
split.template_ID(ob, "data")
|
||||
split.itemS()
|
||||
elif arm:
|
||||
split.template_ID(space, "pin_id")
|
||||
split.itemS()
|
||||
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()
|
||||
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")
|
||||
|
||||
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
|
||||
bl_label = "Display"
|
||||
|
||||
layout.row().itemR(arm, "drawtype", expand=True)
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
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")
|
||||
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)
|
||||
bl_label = "Bone Groups"
|
||||
|
||||
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")
|
||||
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"
|
||||
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")
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
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")
|
||||
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"
|
||||
bl_label = "Ghost"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
arm = context.armature
|
||||
|
||||
layout.itemR(arm, "ghost_type", expand=True)
|
||||
|
||||
split = layout.split()
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
col = split.column()
|
||||
arm = context.armature
|
||||
|
||||
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")
|
||||
layout.itemR(arm, "ghost_type", expand=True)
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Display:")
|
||||
col.itemR(arm, "ghost_only_selected", text="Selected Only")
|
||||
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)
|
||||
|
@ -1,225 +1,225 @@
|
||||
|
||||
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
|
||||
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="")
|
||||
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"
|
||||
bl_label = "Transform"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
ob = context.object
|
||||
bone = context.bone
|
||||
if not bone:
|
||||
bone = context.edit_bone
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
row = layout.row()
|
||||
row.column().itemR(bone, "head")
|
||||
row.column().itemR(bone, "tail")
|
||||
ob = context.object
|
||||
bone = context.bone
|
||||
if not bone:
|
||||
bone = context.edit_bone
|
||||
|
||||
col = row.column()
|
||||
sub = col.column(align=True)
|
||||
sub.itemL(text="Roll:")
|
||||
sub.itemR(bone, "roll", text="")
|
||||
sub.itemL()
|
||||
sub.itemR(bone, "locked")
|
||||
row = layout.row()
|
||||
row.column().itemR(bone, "head")
|
||||
row.column().itemR(bone, "tail")
|
||||
|
||||
else:
|
||||
pchan = ob.pose.pose_channels[context.bone.name]
|
||||
col = row.column()
|
||||
sub = col.column(align=True)
|
||||
sub.itemL(text="Roll:")
|
||||
sub.itemR(bone, "roll", text="")
|
||||
sub.itemL()
|
||||
sub.itemR(bone, "locked")
|
||||
|
||||
row = layout.row()
|
||||
col = row.column()
|
||||
col.itemR(pchan, "location")
|
||||
col.active = not (bone.parent and bone.connected)
|
||||
else:
|
||||
pchan = ob.pose.pose_channels[context.bone.name]
|
||||
|
||||
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 = 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")
|
||||
|
||||
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"
|
||||
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]
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
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")
|
||||
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
|
||||
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_header(self, context):
|
||||
bone = context.bone
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
bone = context.bone
|
||||
|
||||
if not bone:
|
||||
bone = context.edit_bone
|
||||
|
||||
layout.active = bone.deform
|
||||
|
||||
split = layout.split()
|
||||
if not bone:
|
||||
bone = context.edit_bone
|
||||
|
||||
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")
|
||||
self.layout.itemR(bone, "deform", text="")
|
||||
|
||||
sub = col.column(align=True)
|
||||
sub.itemL(text="Radius:")
|
||||
sub.itemR(bone, "head_radius", text="Head")
|
||||
sub.itemR(bone, "tail_radius", text="Tail")
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
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")
|
||||
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)
|
||||
|
@ -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
|
||||
bl_label = ""
|
||||
bl_show_header = False
|
||||
|
||||
split = layout.split(percentage=0.65)
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
if ob:
|
||||
split.template_ID(ob, "data")
|
||||
split.itemS()
|
||||
elif cam:
|
||||
split.template_ID(space, "pin_id")
|
||||
split.itemS()
|
||||
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"
|
||||
bl_label = "Lens"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
cam = context.camera
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
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="")
|
||||
cam = context.camera
|
||||
|
||||
elif cam.type == 'ORTHO':
|
||||
row.itemR(cam, "ortho_scale")
|
||||
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")
|
||||
|
||||
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"
|
||||
bl_label = "Display"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
cam = context.camera
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
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)
|
||||
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)
|
||||
|
@ -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
|
||||
bl_label = ""
|
||||
bl_show_header = False
|
||||
|
||||
split = layout.split(percentage=0.65)
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
if ob:
|
||||
split.template_ID(ob, "data")
|
||||
split.itemS()
|
||||
elif curve:
|
||||
split.template_ID(space, "pin_id")
|
||||
split.itemS()
|
||||
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')
|
||||
bl_label = "Shape"
|
||||
|
||||
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:")
|
||||
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")
|
||||
col.itemR(curve, "auto_texspace")
|
||||
|
||||
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 = 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"
|
||||
bl_label = "Geometry"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
curve = context.curve
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
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="")
|
||||
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
|
||||
bl_label = "Path Animation"
|
||||
|
||||
self.layout.itemR(curve, "use_path", text="")
|
||||
def draw_header(self, context):
|
||||
curve = context.curve
|
||||
|
||||
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")
|
||||
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")
|
||||
|
||||
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"
|
||||
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")
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
|
||||
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")
|
||||
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)
|
||||
|
@ -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)
|
||||
|
@ -2,306 +2,306 @@
|
||||
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
|
||||
bl_label = ""
|
||||
bl_show_header = False
|
||||
|
||||
split = layout.split(percentage=0.65)
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
if ob:
|
||||
split.template_ID(ob, "data")
|
||||
split.itemS()
|
||||
elif lamp:
|
||||
split.template_ID(space, "pin_id")
|
||||
split.itemS()
|
||||
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"
|
||||
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")
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
if lamp.type in ('POINT', 'SPOT'):
|
||||
sub.itemL(text="Falloff:")
|
||||
sub.itemR(lamp, "falloff_type", text="")
|
||||
sub.itemR(lamp, "distance")
|
||||
lamp = context.lamp
|
||||
|
||||
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")
|
||||
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')
|
||||
bl_label = "Sky & Atmosphere"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
lamp = context.lamp.sky
|
||||
def poll(self, context):
|
||||
lamp = context.lamp
|
||||
return (lamp and lamp.type == 'SUN')
|
||||
|
||||
layout.itemR(lamp, "sky")
|
||||
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")
|
||||
|
||||
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'))
|
||||
bl_label = "Shadow"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
lamp = context.lamp
|
||||
def poll(self, context):
|
||||
lamp = context.lamp
|
||||
return (lamp and lamp.type in ('POINT','SUN', 'SPOT', 'AREA'))
|
||||
|
||||
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")
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
elif lamp.shadow_method == 'BUFFER_SHADOW':
|
||||
col = layout.column()
|
||||
col.itemL(text="Buffer Type:")
|
||||
col.row().itemR(lamp, "shadow_buffer_type", expand=True)
|
||||
lamp = context.lamp
|
||||
|
||||
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")
|
||||
layout.itemR(lamp, "shadow_method", expand=True)
|
||||
|
||||
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")
|
||||
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')
|
||||
bl_label = "Area Shape"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
lamp = context.lamp
|
||||
def poll(self, context):
|
||||
lamp = context.lamp
|
||||
return (lamp and lamp.type == 'AREA')
|
||||
|
||||
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")
|
||||
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')
|
||||
bl_label = "Spot Shape"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
lamp = context.lamp
|
||||
def poll(self, context):
|
||||
lamp = context.lamp
|
||||
return (lamp and lamp.type == 'SPOT')
|
||||
|
||||
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")
|
||||
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
|
||||
|
||||
return (lamp and lamp.type in ('POINT', 'SPOT') and lamp.falloff_type == 'CUSTOM_CURVE')
|
||||
def poll(self, context):
|
||||
lamp = context.lamp
|
||||
|
||||
def draw(self, context):
|
||||
lamp = context.lamp
|
||||
return (lamp and lamp.type in ('POINT', 'SPOT') and lamp.falloff_type == 'CUSTOM_CURVE')
|
||||
|
||||
self.layout.template_curve_mapping(lamp, "falloff_curve")
|
||||
def draw(self, context):
|
||||
lamp = context.lamp
|
||||
|
||||
self.layout.template_curve_mapping(lamp, "falloff_curve")
|
||||
|
||||
bpy.types.register(DATA_PT_context_lamp)
|
||||
bpy.types.register(DATA_PT_preview)
|
||||
|
@ -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
|
||||
bl_label = ""
|
||||
bl_show_header = False
|
||||
|
||||
split = layout.split(percentage=0.65)
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
if ob:
|
||||
split.template_ID(ob, "data")
|
||||
split.itemS()
|
||||
elif lat:
|
||||
split.template_ID(space, "pin_id")
|
||||
split.itemS()
|
||||
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"
|
||||
bl_label = "Lattice"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
lat = context.lattice
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
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")
|
||||
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)
|
||||
|
@ -2,236 +2,236 @@
|
||||
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
|
||||
bl_label = ""
|
||||
bl_show_header = False
|
||||
|
||||
split = layout.split(percentage=0.65)
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
if ob:
|
||||
split.template_ID(ob, "data")
|
||||
split.itemS()
|
||||
elif mesh:
|
||||
split.template_ID(space, "pin_id")
|
||||
split.itemS()
|
||||
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"
|
||||
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")
|
||||
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"
|
||||
bl_label = "Settings"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
mesh = context.mesh
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.itemR(mesh, "texture_mesh")
|
||||
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'))
|
||||
bl_label = "Vertex Groups"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
ob = context.object
|
||||
group = ob.active_vertex_group
|
||||
def poll(self, context):
|
||||
return (context.object and context.object.type in ('MESH', 'LATTICE'))
|
||||
|
||||
rows = 2
|
||||
if group:
|
||||
rows= 5
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
row = layout.row()
|
||||
row.template_list(ob, "vertex_groups", ob, "active_vertex_group_index", rows=rows)
|
||||
ob = context.object
|
||||
group = ob.active_vertex_group
|
||||
|
||||
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="")
|
||||
rows = 2
|
||||
if group:
|
||||
rows= 5
|
||||
|
||||
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="")
|
||||
row = layout.row()
|
||||
row.template_list(ob, "vertex_groups", ob, "active_vertex_group_index", rows=rows)
|
||||
|
||||
if group:
|
||||
row = layout.row()
|
||||
row.itemR(group, "name")
|
||||
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="")
|
||||
|
||||
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")
|
||||
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="")
|
||||
|
||||
layout.itemR(context.tool_settings, "vertex_group_weight", text="Weight")
|
||||
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'))
|
||||
bl_label = "Shape Keys"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
ob = context.object
|
||||
key = ob.data.shape_keys
|
||||
kb = ob.active_shape_key
|
||||
def poll(self, context):
|
||||
return (context.object and context.object.type in ('MESH', 'LATTICE', 'CURVE', 'SURFACE'))
|
||||
|
||||
enable_edit = ob.mode != 'EDIT'
|
||||
enable_edit_value = False
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
if ob.shape_key_lock == False:
|
||||
if enable_edit or (ob.type == 'MESH' and ob.shape_key_edit_mode):
|
||||
enable_edit_value = True
|
||||
ob = context.object
|
||||
key = ob.data.shape_keys
|
||||
kb = ob.active_shape_key
|
||||
|
||||
row = layout.row()
|
||||
enable_edit = ob.mode != 'EDIT'
|
||||
enable_edit_value = False
|
||||
|
||||
rows = 2
|
||||
if kb:
|
||||
rows= 5
|
||||
row.template_list(key, "keys", ob, "active_shape_key_index", rows=rows)
|
||||
if ob.shape_key_lock == False:
|
||||
if enable_edit or (ob.type == 'MESH' and ob.shape_key_edit_mode):
|
||||
enable_edit_value = True
|
||||
|
||||
col = row.column()
|
||||
row = layout.row()
|
||||
|
||||
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="")
|
||||
rows = 2
|
||||
if kb:
|
||||
rows= 5
|
||||
row.template_list(key, "keys", ob, "active_shape_key_index", rows=rows)
|
||||
|
||||
if kb:
|
||||
col.itemS()
|
||||
col = row.column()
|
||||
|
||||
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="")
|
||||
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="")
|
||||
|
||||
split = layout.split(percentage=0.4)
|
||||
sub = split.row()
|
||||
sub.enabled = enable_edit
|
||||
sub.itemR(key, "relative")
|
||||
if kb:
|
||||
col.itemS()
|
||||
|
||||
sub = split.row()
|
||||
sub.alignment = 'RIGHT'
|
||||
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="")
|
||||
|
||||
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="")
|
||||
split = layout.split(percentage=0.4)
|
||||
sub = split.row()
|
||||
sub.enabled = enable_edit
|
||||
sub.itemR(key, "relative")
|
||||
|
||||
sub.itemO("object.shape_key_mirror", icon='ICON_MOD_MIRROR', text="")
|
||||
sub = split.row()
|
||||
sub.alignment = 'RIGHT'
|
||||
|
||||
sub.itemR(ob, "shape_key_edit_mode", text="")
|
||||
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="")
|
||||
|
||||
row = layout.row()
|
||||
row.itemR(kb, "name")
|
||||
sub.itemO("object.shape_key_mirror", icon='ICON_MOD_MIRROR', text="")
|
||||
|
||||
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")
|
||||
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
|
||||
bl_label = "UV Texture"
|
||||
|
||||
row = layout.row()
|
||||
col = row.column()
|
||||
|
||||
col.template_list(me, "uv_textures", me, "active_uv_texture_index", rows=2)
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
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="")
|
||||
me = context.mesh
|
||||
|
||||
lay = me.active_uv_texture
|
||||
if lay:
|
||||
layout.itemR(lay, "name")
|
||||
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"
|
||||
|
||||
row = layout.row()
|
||||
col = row.column()
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
col.template_list(me, "vertex_colors", me, "active_vertex_color_index", rows=2)
|
||||
me = context.mesh
|
||||
|
||||
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="")
|
||||
row = layout.row()
|
||||
col = row.column()
|
||||
|
||||
lay = me.active_vertex_color
|
||||
if lay:
|
||||
layout.itemR(lay, "name")
|
||||
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="")
|
||||
|
||||
lay = me.active_vertex_color
|
||||
if lay:
|
||||
layout.itemR(lay, "name")
|
||||
|
||||
bpy.types.register(DATA_PT_context_mesh)
|
||||
bpy.types.register(DATA_PT_normals)
|
||||
|
@ -1,106 +1,106 @@
|
||||
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
|
||||
bl_label = ""
|
||||
bl_show_header = False
|
||||
|
||||
split = layout.split(percentage=0.65)
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
if ob:
|
||||
split.template_ID(ob, "data")
|
||||
split.itemS()
|
||||
elif mball:
|
||||
split.template_ID(space, "pin_id")
|
||||
split.itemS()
|
||||
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"
|
||||
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")
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
layout.itemL(text="Update:")
|
||||
layout.itemR(mball, "flag", expand=True)
|
||||
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)
|
||||
bl_label = "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")
|
||||
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)
|
||||
|
@ -2,448 +2,448 @@
|
||||
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"
|
||||
bl_label = "Modifiers"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
ob = context.object
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
row = layout.row()
|
||||
row.item_menu_enumO("object.modifier_add", "type")
|
||||
row.itemL()
|
||||
ob = context.object
|
||||
|
||||
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.
|
||||
row = layout.row()
|
||||
row.item_menu_enumO("object.modifier_add", "type")
|
||||
row.itemL()
|
||||
|
||||
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()
|
||||
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)
|
||||
|
||||
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")
|
||||
# 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.
|
||||
|
||||
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="")
|
||||
def ARMATURE(self, layout, ob, md):
|
||||
layout.itemR(md, "object")
|
||||
|
||||
col.itemS()
|
||||
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")
|
||||
|
||||
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="")
|
||||
layout.itemS()
|
||||
|
||||
col.itemS()
|
||||
split = layout.split()
|
||||
|
||||
col.itemR(md, "add_offset_object")
|
||||
sub = col.column()
|
||||
sub.active = md.add_offset_object
|
||||
sub.itemR(md, "offset_object", text="")
|
||||
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")
|
||||
|
||||
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.itemL(text="Deformation:")
|
||||
col.itemR(md, "quaternion")
|
||||
col.itemR(md, "multi_modifier")
|
||||
|
||||
col = split.column()
|
||||
col.itemR(md, "randomize")
|
||||
sub = col.column()
|
||||
sub.active = md.randomize
|
||||
sub.itemR(md, "seed")
|
||||
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")
|
||||
|
||||
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.itemS()
|
||||
|
||||
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")
|
||||
split = layout.split()
|
||||
|
||||
flow = layout.column_flow(2)
|
||||
flow.itemR(md, "split_edges")
|
||||
flow.itemR(md, "unborn")
|
||||
flow.itemR(md, "alive")
|
||||
flow.itemR(md, "dead")
|
||||
col = split.column()
|
||||
col.itemR(md, "constant_offset")
|
||||
sub = col.column()
|
||||
sub.active = md.constant_offset
|
||||
sub.itemR(md, "constant_offset_displacement", text="")
|
||||
|
||||
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")
|
||||
col.itemS()
|
||||
|
||||
split = layout.split()
|
||||
split.itemR(md, "falloff")
|
||||
split.itemR(md, "force", slider=True)
|
||||
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")
|
||||
|
||||
layout.itemS()
|
||||
col = split.column()
|
||||
col.itemR(md, "relative_offset")
|
||||
sub = col.column()
|
||||
sub.active = md.relative_offset
|
||||
sub.itemR(md, "relative_offset_displacement", text="")
|
||||
|
||||
row = layout.row()
|
||||
row.itemO("object.hook_reset", text="Reset")
|
||||
row.itemO("object.hook_recenter", text="Recenter")
|
||||
col.itemS()
|
||||
|
||||
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")
|
||||
col.itemR(md, "add_offset_object")
|
||||
sub = col.column()
|
||||
sub.active = md.add_offset_object
|
||||
sub.itemR(md, "offset_object", text="")
|
||||
|
||||
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.itemS()
|
||||
|
||||
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")
|
||||
col = layout.column()
|
||||
col.itemR(md, "start_cap")
|
||||
col.itemR(md, "end_cap")
|
||||
|
||||
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")
|
||||
def BEVEL(self, layout, ob, md):
|
||||
row = layout.row()
|
||||
row.itemR(md, "width")
|
||||
row.itemR(md, "only_vertices")
|
||||
|
||||
split = layout.split()
|
||||
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)
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Aspect Ratio:")
|
||||
def BOOLEAN(self, layout, ob, md):
|
||||
layout.itemR(md, "operation")
|
||||
layout.itemR(md, "object")
|
||||
|
||||
sub = col.column(align=True)
|
||||
sub.itemR(md, "horizontal_aspect_ratio", text="Horizontal")
|
||||
sub.itemR(md, "vertical_aspect_ratio", text="Vertical")
|
||||
def BUILD(self, layout, ob, md):
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Projectors:")
|
||||
col = split.column()
|
||||
col.itemR(md, "start")
|
||||
col.itemR(md, "length")
|
||||
|
||||
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.itemR(md, "randomize")
|
||||
sub = col.column()
|
||||
sub.active = md.randomize
|
||||
sub.itemR(md, "seed")
|
||||
|
||||
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)
|
||||
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)
|
||||
|
@ -2,178 +2,178 @@
|
||||
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
|
||||
|
||||
ob = context.object
|
||||
curve = context.curve
|
||||
space = context.space_data
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
split = layout.split(percentage=0.65)
|
||||
ob = context.object
|
||||
curve = context.curve
|
||||
space = context.space_data
|
||||
|
||||
if ob:
|
||||
split.template_ID(ob, "data")
|
||||
split.itemS()
|
||||
elif curve:
|
||||
split.template_ID(space, "pin_id")
|
||||
split.itemS()
|
||||
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_text(DataButtonsPanel):
|
||||
bl_label = "Shape Text"
|
||||
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")
|
||||
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"
|
||||
bl_label = "Geometry"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
curve = context.curve
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
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="")
|
||||
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"
|
||||
bl_label = "Font"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
text = context.curve
|
||||
char = context.curve.edit_format
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
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="")
|
||||
text = context.curve
|
||||
char = context.curve.edit_format
|
||||
|
||||
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")
|
||||
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"
|
||||
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")
|
||||
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)
|
||||
|
@ -1,317 +1,317 @@
|
||||
|
||||
import bpy
|
||||
|
||||
class PhysicsButtonsPanel(bpy.types.Panel):
|
||||
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')
|
||||
class PhysicsButtonsPanel(bpy.types.Panel):
|
||||
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')
|
||||
|
||||
class PHYSICS_PT_game_physics(PhysicsButtonsPanel):
|
||||
bl_label = "Physics"
|
||||
bl_label = "Physics"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
ob = context.active_object
|
||||
game = ob.game
|
||||
soft = ob.game.soft_body
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
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")
|
||||
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")
|
||||
|
||||
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"
|
||||
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 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
|
||||
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
|
||||
self.layout.itemR(game, "use_collision_bounds", text="")
|
||||
|
||||
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)
|
||||
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"
|
||||
bl_label = "Standalone Player"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
gs = context.scene.game_data
|
||||
|
||||
layout.itemR(gs, "fullscreen")
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
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")
|
||||
gs = context.scene.game_data
|
||||
|
||||
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)
|
||||
layout.itemR(gs, "fullscreen")
|
||||
|
||||
# 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="")
|
||||
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"
|
||||
bl_label = "Stereo"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
gs = context.scene.game_data
|
||||
stereo_mode = gs.stereo
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
# 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")
|
||||
gs = context.scene.game_data
|
||||
stereo_mode = gs.stereo
|
||||
|
||||
# dome:
|
||||
elif stereo_mode == 'DOME':
|
||||
layout.itemR(gs, "dome_mode", text="Dome Type")
|
||||
# stereo options:
|
||||
layout.itemR(gs, "stereo", expand=True)
|
||||
|
||||
dome_type = gs.dome_mode
|
||||
# stereo:
|
||||
if stereo_mode == 'STEREO':
|
||||
layout.itemR(gs, "stereo_mode")
|
||||
layout.itemL(text="To do: Focal Length")
|
||||
layout.itemL(text="To do: Eye Separation")
|
||||
|
||||
split=layout.split()
|
||||
# dome:
|
||||
elif stereo_mode == 'DOME':
|
||||
layout.itemR(gs, "dome_mode", text="Dome Type")
|
||||
|
||||
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")
|
||||
dome_type = gs.dome_mode
|
||||
|
||||
col=split.column()
|
||||
col.itemR(gs, "dome_tesselation", text="Tesselation")
|
||||
col.itemR(gs, "dome_buffer_resolution", text="Resolution", slider=True)
|
||||
split=layout.split()
|
||||
|
||||
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)
|
||||
if dome_type == 'FISHEYE' or \
|
||||
dome_type == 'TRUNCATED_REAR' or \
|
||||
dome_type == 'TRUNCATED_FRONT':
|
||||
|
||||
else: # cube map
|
||||
col=split.column()
|
||||
col.itemR(gs, "dome_buffer_resolution", text="Resolution", slider=True)
|
||||
|
||||
layout.itemR(gs, "dome_text")
|
||||
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"
|
||||
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()
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
col = split.column()
|
||||
col.itemR(gs, "glsl_lights", text="Lights")
|
||||
col.itemR(gs, "glsl_shaders", text="Shaders")
|
||||
col.itemR(gs, "glsl_shadows", text="Shadows")
|
||||
gs = context.scene.game_data
|
||||
layout.itemR(gs, "material_mode", expand=True)
|
||||
|
||||
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")
|
||||
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"
|
||||
bl_label = "Performance"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
gs = context.scene.game_data
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
split = layout.split()
|
||||
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")
|
||||
|
||||
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
|
||||
|
||||
scene = context.scene
|
||||
world = context.world
|
||||
space = context.space_data
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
split = layout.split(percentage=0.65)
|
||||
scene = context.scene
|
||||
world = context.world
|
||||
space = context.space_data
|
||||
|
||||
if scene:
|
||||
split.template_ID(scene, "world", new="world.new")
|
||||
elif world:
|
||||
split.template_ID(space, "pin_id")
|
||||
split = layout.split(percentage=0.65)
|
||||
|
||||
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")
|
||||
bl_label = "Physics"
|
||||
|
||||
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")
|
||||
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)
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -2,219 +2,219 @@
|
||||
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
|
||||
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="")
|
||||
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"
|
||||
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")
|
||||
|
||||
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"
|
||||
bl_label = "Relations"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
ob = context.object
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.itemR(ob, "layers")
|
||||
col.itemS()
|
||||
col.itemR(ob, "pass_index")
|
||||
ob = context.object
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Parent:")
|
||||
col.itemR(ob, "parent", text="")
|
||||
split = layout.split()
|
||||
|
||||
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
|
||||
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
|
||||
|
||||
ob = context.object
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
split = layout.split()
|
||||
split.item_menu_enumO("object.group_add", "group", text="Add to Group")
|
||||
split.itemL()
|
||||
ob = context.object
|
||||
|
||||
for group in bpy.data.groups:
|
||||
if ob.name in group.objects:
|
||||
col = layout.column(align=True)
|
||||
split = layout.split()
|
||||
split.item_menu_enumO("object.group_add", "group", text="Add to Group")
|
||||
split.itemL()
|
||||
|
||||
col.set_context_pointer("group", group)
|
||||
for group in bpy.data.groups:
|
||||
if ob.name in group.objects:
|
||||
col = layout.column(align=True)
|
||||
|
||||
row = col.box().row()
|
||||
row.itemR(group, "name", text="")
|
||||
row.itemO("object.group_remove", text="", icon='VICON_X')
|
||||
col.set_context_pointer("group", group)
|
||||
|
||||
split = col.box().split()
|
||||
split.column().itemR(group, "layer", text="Dupli")
|
||||
split.column().itemR(group, "dupli_offset", text="")
|
||||
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="")
|
||||
|
||||
class OBJECT_PT_display(ObjectButtonsPanel):
|
||||
bl_label = "Display"
|
||||
bl_label = "Display"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
ob = context.object
|
||||
|
||||
split = layout.split()
|
||||
col = split.column()
|
||||
col.itemR(ob, "max_draw_type", text="Type")
|
||||
col = split.column()
|
||||
row = col.row()
|
||||
row.itemR(ob, "draw_bounds", text="Bounds")
|
||||
sub = row.row()
|
||||
sub.active = ob.draw_bounds
|
||||
sub.itemR(ob, "draw_bounds_type", text="")
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
flow = layout.column_flow()
|
||||
flow.itemR(ob, "draw_name", text="Name")
|
||||
flow.itemR(ob, "draw_axis", text="Axis")
|
||||
flow.itemR(ob, "draw_wire", text="Wire")
|
||||
flow.itemR(ob, "draw_texture_space", text="Texture Space")
|
||||
flow.itemR(ob, "x_ray", text="X-Ray")
|
||||
flow.itemR(ob, "draw_transparent", text="Transparency")
|
||||
ob = context.object
|
||||
|
||||
split = layout.split()
|
||||
col = split.column()
|
||||
col.itemR(ob, "max_draw_type", text="Type")
|
||||
col = split.column()
|
||||
row = col.row()
|
||||
row.itemR(ob, "draw_bounds", text="Bounds")
|
||||
sub = row.row()
|
||||
sub.active = ob.draw_bounds
|
||||
sub.itemR(ob, "draw_bounds_type", text="")
|
||||
|
||||
flow = layout.column_flow()
|
||||
flow.itemR(ob, "draw_name", text="Name")
|
||||
flow.itemR(ob, "draw_axis", text="Axis")
|
||||
flow.itemR(ob, "draw_wire", text="Wire")
|
||||
flow.itemR(ob, "draw_texture_space", text="Texture Space")
|
||||
flow.itemR(ob, "x_ray", text="X-Ray")
|
||||
flow.itemR(ob, "draw_transparent", text="Transparency")
|
||||
|
||||
class OBJECT_PT_duplication(ObjectButtonsPanel):
|
||||
bl_label = "Duplication"
|
||||
bl_label = "Duplication"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
ob = context.object
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
layout.itemR(ob, "dupli_type", expand=True)
|
||||
ob = context.object
|
||||
|
||||
if ob.dupli_type == 'FRAMES':
|
||||
split = layout.split()
|
||||
|
||||
col = split.column(align=True)
|
||||
col.itemR(ob, "dupli_frames_start", text="Start")
|
||||
col.itemR(ob, "dupli_frames_end", text="End")
|
||||
|
||||
col = split.column(align=True)
|
||||
col.itemR(ob, "dupli_frames_on", text="On")
|
||||
col.itemR(ob, "dupli_frames_off", text="Off")
|
||||
|
||||
layout.itemR(ob, "dupli_frames_no_speed", text="No Speed")
|
||||
layout.itemR(ob, "dupli_type", expand=True)
|
||||
|
||||
elif ob.dupli_type == 'VERTS':
|
||||
layout.itemR(ob, "dupli_verts_rotation", text="Rotation")
|
||||
if ob.dupli_type == 'FRAMES':
|
||||
split = layout.split()
|
||||
|
||||
elif ob.dupli_type == 'FACES':
|
||||
row = layout.row()
|
||||
row.itemR(ob, "dupli_faces_scale", text="Scale")
|
||||
row.itemR(ob, "dupli_faces_inherit_scale", text="Inherit Scale")
|
||||
col = split.column(align=True)
|
||||
col.itemR(ob, "dupli_frames_start", text="Start")
|
||||
col.itemR(ob, "dupli_frames_end", text="End")
|
||||
|
||||
elif ob.dupli_type == 'GROUP':
|
||||
layout.itemR(ob, "dupli_group", text="Group")
|
||||
col = split.column(align=True)
|
||||
col.itemR(ob, "dupli_frames_on", text="On")
|
||||
col.itemR(ob, "dupli_frames_off", text="Off")
|
||||
|
||||
layout.itemR(ob, "dupli_frames_no_speed", text="No Speed")
|
||||
|
||||
elif ob.dupli_type == 'VERTS':
|
||||
layout.itemR(ob, "dupli_verts_rotation", text="Rotation")
|
||||
|
||||
elif ob.dupli_type == 'FACES':
|
||||
row = layout.row()
|
||||
row.itemR(ob, "dupli_faces_scale", text="Scale")
|
||||
row.itemR(ob, "dupli_faces_inherit_scale", text="Inherit Scale")
|
||||
|
||||
elif ob.dupli_type == 'GROUP':
|
||||
layout.itemR(ob, "dupli_group", text="Group")
|
||||
|
||||
class OBJECT_PT_animation(ObjectButtonsPanel):
|
||||
bl_label = "Animation"
|
||||
bl_label = "Animation"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
ob = context.object
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Time Offset:")
|
||||
col.itemR(ob, "time_offset_edit", text="Edit")
|
||||
row = col.row()
|
||||
row.itemR(ob, "time_offset_particle", text="Particle")
|
||||
row.active = len(ob.particle_systems) != 0
|
||||
row = col.row()
|
||||
row.itemR(ob, "time_offset_parent", text="Parent")
|
||||
row.active = ob.parent != None
|
||||
row = col.row()
|
||||
row.itemR(ob, "slow_parent")
|
||||
row.active = ob.parent != None
|
||||
col.itemR(ob, "time_offset", text="Offset")
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Track:")
|
||||
col.itemR(ob, "track", text="")
|
||||
col.itemR(ob, "track_axis", text="Axis")
|
||||
col.itemR(ob, "up_axis", text="Up Axis")
|
||||
row = col.row()
|
||||
row.itemR(ob, "track_override_parent", text="Override Parent")
|
||||
row.active = ob.parent != None
|
||||
ob = context.object
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Time Offset:")
|
||||
col.itemR(ob, "time_offset_edit", text="Edit")
|
||||
row = col.row()
|
||||
row.itemR(ob, "time_offset_particle", text="Particle")
|
||||
row.active = len(ob.particle_systems) != 0
|
||||
row = col.row()
|
||||
row.itemR(ob, "time_offset_parent", text="Parent")
|
||||
row.active = ob.parent != None
|
||||
row = col.row()
|
||||
row.itemR(ob, "slow_parent")
|
||||
row.active = ob.parent != None
|
||||
col.itemR(ob, "time_offset", text="Offset")
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Track:")
|
||||
col.itemR(ob, "track", text="")
|
||||
col.itemR(ob, "track_axis", text="Axis")
|
||||
col.itemR(ob, "up_axis", text="Up Axis")
|
||||
row = col.row()
|
||||
row.itemR(ob, "track_override_parent", text="Override Parent")
|
||||
row.active = ob.parent != None
|
||||
|
||||
bpy.types.register(OBJECT_PT_context_object)
|
||||
bpy.types.register(OBJECT_PT_transform)
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -5,181 +5,181 @@ from buttons_physics_common import point_cache_ui
|
||||
from buttons_physics_common import effector_weights_ui
|
||||
|
||||
def cloth_panel_enabled(md):
|
||||
return md.point_cache.baked==False
|
||||
return md.point_cache.baked==False
|
||||
|
||||
class PhysicButtonsPanel(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.object
|
||||
rd = context.scene.render_data
|
||||
return (ob and ob.type == 'MESH') and (not rd.use_game_engine)
|
||||
|
||||
def poll(self, context):
|
||||
ob = context.object
|
||||
rd = context.scene.render_data
|
||||
return (ob and ob.type == 'MESH') and (not rd.use_game_engine)
|
||||
|
||||
class PHYSICS_PT_cloth(PhysicButtonsPanel):
|
||||
bl_label = "Cloth"
|
||||
bl_label = "Cloth"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
md = context.cloth
|
||||
ob = context.object
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
split = layout.split()
|
||||
split.operator_context = 'EXEC_DEFAULT'
|
||||
md = context.cloth
|
||||
ob = context.object
|
||||
|
||||
if md:
|
||||
# remove modifier + settings
|
||||
split.set_context_pointer("modifier", md)
|
||||
split.itemO("object.modifier_remove", text="Remove")
|
||||
split = layout.split()
|
||||
split.operator_context = 'EXEC_DEFAULT'
|
||||
|
||||
row = split.row(align=True)
|
||||
row.itemR(md, "render", text="")
|
||||
row.itemR(md, "realtime", text="")
|
||||
else:
|
||||
# add modifier
|
||||
split.item_enumO("object.modifier_add", "type", 'CLOTH', text="Add")
|
||||
split.itemL()
|
||||
if md:
|
||||
# remove modifier + settings
|
||||
split.set_context_pointer("modifier", md)
|
||||
split.itemO("object.modifier_remove", text="Remove")
|
||||
|
||||
if md:
|
||||
cloth = md.settings
|
||||
|
||||
layout.active = cloth_panel_enabled(md)
|
||||
row = split.row(align=True)
|
||||
row.itemR(md, "render", text="")
|
||||
row.itemR(md, "realtime", text="")
|
||||
else:
|
||||
# add modifier
|
||||
split.item_enumO("object.modifier_add", "type", 'CLOTH', text="Add")
|
||||
split.itemL()
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
|
||||
col.itemL(text="Quality:")
|
||||
col.itemR(cloth, "quality", text="Steps",slider=True)
|
||||
|
||||
col.itemL(text="Material:")
|
||||
sub = col.column(align=True)
|
||||
sub.itemR(cloth, "mass")
|
||||
sub.itemR(cloth, "structural_stiffness", text="Structural")
|
||||
sub.itemR(cloth, "bending_stiffness", text="Bending")
|
||||
|
||||
col = split.column()
|
||||
|
||||
col.itemL(text="Presets:")
|
||||
col.itemL(text="TODO!")
|
||||
if md:
|
||||
cloth = md.settings
|
||||
|
||||
col.itemL(text="Damping:")
|
||||
sub = col.column(align=True)
|
||||
sub.itemR(cloth, "spring_damping", text="Spring")
|
||||
sub.itemR(cloth, "air_damping", text="Air")
|
||||
layout.active = cloth_panel_enabled(md)
|
||||
|
||||
col.itemR(cloth, "pin_cloth", text="Pin")
|
||||
sub = col.column(align=True)
|
||||
sub.active = cloth.pin_cloth
|
||||
sub.itemR(cloth, "pin_stiffness", text="Stiffness")
|
||||
sub.item_pointerR(cloth, "mass_vertex_group", ob, "vertex_groups", text="")
|
||||
|
||||
# Disabled for now
|
||||
"""
|
||||
if cloth.mass_vertex_group:
|
||||
layout.itemL(text="Goal:")
|
||||
|
||||
col = layout.column_flow()
|
||||
col.itemR(cloth, "goal_default", text="Default")
|
||||
col.itemR(cloth, "goal_spring", text="Stiffness")
|
||||
col.itemR(cloth, "goal_friction", text="Friction")
|
||||
"""
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
|
||||
col.itemL(text="Quality:")
|
||||
col.itemR(cloth, "quality", text="Steps",slider=True)
|
||||
|
||||
col.itemL(text="Material:")
|
||||
sub = col.column(align=True)
|
||||
sub.itemR(cloth, "mass")
|
||||
sub.itemR(cloth, "structural_stiffness", text="Structural")
|
||||
sub.itemR(cloth, "bending_stiffness", text="Bending")
|
||||
|
||||
col = split.column()
|
||||
|
||||
col.itemL(text="Presets:")
|
||||
col.itemL(text="TODO!")
|
||||
|
||||
col.itemL(text="Damping:")
|
||||
sub = col.column(align=True)
|
||||
sub.itemR(cloth, "spring_damping", text="Spring")
|
||||
sub.itemR(cloth, "air_damping", text="Air")
|
||||
|
||||
col.itemR(cloth, "pin_cloth", text="Pin")
|
||||
sub = col.column(align=True)
|
||||
sub.active = cloth.pin_cloth
|
||||
sub.itemR(cloth, "pin_stiffness", text="Stiffness")
|
||||
sub.item_pointerR(cloth, "mass_vertex_group", ob, "vertex_groups", text="")
|
||||
|
||||
# Disabled for now
|
||||
"""
|
||||
if cloth.mass_vertex_group:
|
||||
layout.itemL(text="Goal:")
|
||||
|
||||
col = layout.column_flow()
|
||||
col.itemR(cloth, "goal_default", text="Default")
|
||||
col.itemR(cloth, "goal_spring", text="Stiffness")
|
||||
col.itemR(cloth, "goal_friction", text="Friction")
|
||||
"""
|
||||
|
||||
class PHYSICS_PT_cloth_cache(PhysicButtonsPanel):
|
||||
bl_label = "Cloth Cache"
|
||||
bl_default_closed = True
|
||||
bl_label = "Cloth Cache"
|
||||
bl_default_closed = True
|
||||
|
||||
def poll(self, context):
|
||||
return context.cloth
|
||||
def poll(self, context):
|
||||
return context.cloth
|
||||
|
||||
def draw(self, context):
|
||||
md = context.cloth
|
||||
point_cache_ui(self, md.point_cache, cloth_panel_enabled(md), 0, 0)
|
||||
|
||||
def draw(self, context):
|
||||
md = context.cloth
|
||||
point_cache_ui(self, md.point_cache, cloth_panel_enabled(md), 0, 0)
|
||||
|
||||
class PHYSICS_PT_cloth_collision(PhysicButtonsPanel):
|
||||
bl_label = "Cloth Collision"
|
||||
bl_default_closed = True
|
||||
bl_label = "Cloth Collision"
|
||||
bl_default_closed = True
|
||||
|
||||
def poll(self, context):
|
||||
return context.cloth
|
||||
|
||||
def draw_header(self, context):
|
||||
cloth = context.cloth.collision_settings
|
||||
|
||||
self.layout.active = cloth_panel_enabled(context.cloth)
|
||||
self.layout.itemR(cloth, "enable_collision", text="")
|
||||
def poll(self, context):
|
||||
return context.cloth
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
cloth = context.cloth.collision_settings
|
||||
md = context.cloth
|
||||
|
||||
layout.active = cloth.enable_collision and cloth_panel_enabled(md)
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.itemR(cloth, "collision_quality", slider=True, text="Quality")
|
||||
col.itemR(cloth, "min_distance", slider=True, text="Distance")
|
||||
col.itemR(cloth, "friction")
|
||||
|
||||
col = split.column()
|
||||
col.itemR(cloth, "enable_self_collision", text="Self Collision")
|
||||
sub = col.column()
|
||||
sub.active = cloth.enable_self_collision
|
||||
sub.itemR(cloth, "self_collision_quality", slider=True, text="Quality")
|
||||
sub.itemR(cloth, "self_min_distance", slider=True, text="Distance")
|
||||
def draw_header(self, context):
|
||||
cloth = context.cloth.collision_settings
|
||||
|
||||
self.layout.active = cloth_panel_enabled(context.cloth)
|
||||
self.layout.itemR(cloth, "enable_collision", text="")
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
cloth = context.cloth.collision_settings
|
||||
md = context.cloth
|
||||
|
||||
layout.active = cloth.enable_collision and cloth_panel_enabled(md)
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.itemR(cloth, "collision_quality", slider=True, text="Quality")
|
||||
col.itemR(cloth, "min_distance", slider=True, text="Distance")
|
||||
col.itemR(cloth, "friction")
|
||||
|
||||
col = split.column()
|
||||
col.itemR(cloth, "enable_self_collision", text="Self Collision")
|
||||
sub = col.column()
|
||||
sub.active = cloth.enable_self_collision
|
||||
sub.itemR(cloth, "self_collision_quality", slider=True, text="Quality")
|
||||
sub.itemR(cloth, "self_min_distance", slider=True, text="Distance")
|
||||
|
||||
class PHYSICS_PT_cloth_stiffness(PhysicButtonsPanel):
|
||||
bl_label = "Cloth Stiffness Scaling"
|
||||
bl_default_closed = True
|
||||
bl_label = "Cloth Stiffness Scaling"
|
||||
bl_default_closed = True
|
||||
|
||||
def poll(self, context):
|
||||
return context.cloth
|
||||
|
||||
def draw_header(self, context):
|
||||
cloth = context.cloth.settings
|
||||
|
||||
self.layout.active = cloth_panel_enabled(context.cloth)
|
||||
self.layout.itemR(cloth, "stiffness_scaling", text="")
|
||||
def poll(self, context):
|
||||
return context.cloth
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
md = context.cloth
|
||||
ob = context.object
|
||||
cloth = context.cloth.settings
|
||||
|
||||
layout.active = cloth.stiffness_scaling and cloth_panel_enabled(md)
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Structural Stiffness:")
|
||||
sub = col.column(align=True)
|
||||
sub.itemR(cloth, "structural_stiffness_max", text="Max")
|
||||
sub.item_pointerR(cloth, "structural_stiffness_vertex_group", ob, "vertex_groups", text="")
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Bending Stiffness:")
|
||||
sub = col.column(align=True)
|
||||
sub.itemR(cloth, "bending_stiffness_max", text="Max")
|
||||
sub.item_pointerR(cloth, "bending_vertex_group", ob, "vertex_groups", text="")
|
||||
def draw_header(self, context):
|
||||
cloth = context.cloth.settings
|
||||
|
||||
self.layout.active = cloth_panel_enabled(context.cloth)
|
||||
self.layout.itemR(cloth, "stiffness_scaling", text="")
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
md = context.cloth
|
||||
ob = context.object
|
||||
cloth = context.cloth.settings
|
||||
|
||||
layout.active = cloth.stiffness_scaling and cloth_panel_enabled(md)
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Structural Stiffness:")
|
||||
sub = col.column(align=True)
|
||||
sub.itemR(cloth, "structural_stiffness_max", text="Max")
|
||||
sub.item_pointerR(cloth, "structural_stiffness_vertex_group", ob, "vertex_groups", text="")
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Bending Stiffness:")
|
||||
sub = col.column(align=True)
|
||||
sub.itemR(cloth, "bending_stiffness_max", text="Max")
|
||||
sub.item_pointerR(cloth, "bending_vertex_group", ob, "vertex_groups", text="")
|
||||
|
||||
class PHYSICS_PT_cloth_field_weights(PhysicButtonsPanel):
|
||||
bl_label = "Cloth Field Weights"
|
||||
bl_default_closed = True
|
||||
|
||||
def poll(self, context):
|
||||
return (context.cloth)
|
||||
|
||||
def draw(self, context):
|
||||
cloth = context.cloth.settings
|
||||
effector_weights_ui(self, cloth.effector_weights)
|
||||
|
||||
bl_label = "Cloth Field Weights"
|
||||
bl_default_closed = True
|
||||
|
||||
def poll(self, context):
|
||||
return (context.cloth)
|
||||
|
||||
def draw(self, context):
|
||||
cloth = context.cloth.settings
|
||||
effector_weights_ui(self, cloth.effector_weights)
|
||||
|
||||
bpy.types.register(PHYSICS_PT_cloth)
|
||||
bpy.types.register(PHYSICS_PT_cloth_cache)
|
||||
bpy.types.register(PHYSICS_PT_cloth_collision)
|
||||
|
@ -1,159 +1,159 @@
|
||||
import bpy
|
||||
|
||||
def point_cache_ui(self, cache, enabled, particles, smoke):
|
||||
layout = self.layout
|
||||
layout.set_context_pointer("PointCache", cache)
|
||||
|
||||
row = layout.row()
|
||||
row.template_list(cache, "point_cache_list", cache, "active_point_cache_index", rows=2 )
|
||||
col = row.column(align=True)
|
||||
col.itemO("ptcache.add_new", icon='ICON_ZOOMIN', text="")
|
||||
col.itemO("ptcache.remove", icon='ICON_ZOOMOUT', text="")
|
||||
|
||||
row = layout.row()
|
||||
row.itemL(text="File Name:")
|
||||
if particles:
|
||||
row.itemR(cache, "external")
|
||||
|
||||
if cache.external:
|
||||
split = layout.split(percentage=0.80)
|
||||
split.itemR(cache, "name", text="")
|
||||
split.itemR(cache, "index", text="")
|
||||
|
||||
layout.itemL(text="File Path:")
|
||||
layout.itemR(cache, "filepath", text="")
|
||||
|
||||
layout.itemL(text=cache.info)
|
||||
else:
|
||||
layout.itemR(cache, "name", text="")
|
||||
|
||||
if not particles:
|
||||
row = layout.row()
|
||||
row.enabled = enabled
|
||||
row.itemR(cache, "start_frame")
|
||||
row.itemR(cache, "end_frame")
|
||||
|
||||
row = layout.row()
|
||||
|
||||
if cache.baked == True:
|
||||
row.itemO("ptcache.free_bake", text="Free Bake")
|
||||
else:
|
||||
row.item_booleanO("ptcache.bake", "bake", True, text="Bake")
|
||||
|
||||
sub = row.row()
|
||||
sub.enabled = (cache.frames_skipped or cache.outdated) and enabled
|
||||
sub.itemO("ptcache.bake", "bake", False, text="Calculate to Current Frame")
|
||||
|
||||
row = layout.row()
|
||||
row.enabled = enabled
|
||||
row.itemO("ptcache.bake_from_cache", text="Current Cache to Bake")
|
||||
if not smoke:
|
||||
row.itemR(cache, "step");
|
||||
|
||||
if not smoke:
|
||||
row = layout.row()
|
||||
sub = row.row()
|
||||
sub.enabled = enabled
|
||||
sub.itemR(cache, "quick_cache")
|
||||
row.itemR(cache, "disk_cache")
|
||||
|
||||
layout.itemL(text=cache.info)
|
||||
|
||||
layout.itemS()
|
||||
|
||||
row = layout.row()
|
||||
row.item_booleanO("ptcache.bake_all", "bake", True, text="Bake All Dynamics")
|
||||
row.itemO("ptcache.free_bake_all", text="Free All Bakes")
|
||||
layout.itemO("ptcache.bake_all", "bake", False, text="Update All Dynamics to current frame")
|
||||
|
||||
def effector_weights_ui(self, weights):
|
||||
layout = self.layout
|
||||
|
||||
layout.itemR(weights, "group")
|
||||
|
||||
split = layout.split()
|
||||
split.itemR(weights, "gravity", slider=True)
|
||||
split.itemR(weights, "all", slider=True)
|
||||
|
||||
layout.itemS()
|
||||
|
||||
flow = layout.column_flow()
|
||||
flow.itemR(weights, "force", slider=True)
|
||||
flow.itemR(weights, "vortex", slider=True)
|
||||
flow.itemR(weights, "magnetic", slider=True)
|
||||
flow.itemR(weights, "wind", slider=True)
|
||||
flow.itemR(weights, "curveguide", slider=True)
|
||||
flow.itemR(weights, "texture", slider=True)
|
||||
flow.itemR(weights, "harmonic", slider=True)
|
||||
flow.itemR(weights, "charge", slider=True)
|
||||
flow.itemR(weights, "lennardjones", slider=True)
|
||||
flow.itemR(weights, "turbulence", slider=True)
|
||||
flow.itemR(weights, "drag", slider=True)
|
||||
flow.itemR(weights, "boid", slider=True)
|
||||
|
||||
def basic_force_field_settings_ui(self, field):
|
||||
layout = self.layout
|
||||
split = layout.split()
|
||||
|
||||
if not field or field.type == 'NONE':
|
||||
return
|
||||
|
||||
col = split.column()
|
||||
|
||||
if field.type == 'DRAG':
|
||||
col.itemR(field, "linear_drag", text="Linear")
|
||||
else:
|
||||
col.itemR(field, "strength")
|
||||
|
||||
if field.type == 'TURBULENCE':
|
||||
col.itemR(field, "size")
|
||||
col.itemR(field, "flow")
|
||||
elif field.type == 'HARMONIC':
|
||||
col.itemR(field, "harmonic_damping", text="Damping")
|
||||
elif field.type == 'VORTEX' and field.shape != 'POINT':
|
||||
col.itemR(field, "inflow")
|
||||
elif field.type == 'DRAG':
|
||||
col.itemR(field, "quadratic_drag", text="Quadratic")
|
||||
else:
|
||||
col.itemR(field, "flow")
|
||||
|
||||
col = split.column()
|
||||
col.itemR(field, "noise")
|
||||
col.itemR(field, "seed")
|
||||
if field.type == 'TURBULENCE':
|
||||
col.itemR(field, "global_coordinates", text="Global")
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Effect point:")
|
||||
col.itemR(field, "do_location")
|
||||
col.itemR(field, "do_rotation")
|
||||
|
||||
sub = split.column()
|
||||
sub.itemL(text="Collision:")
|
||||
sub.itemR(field, "do_absorption")
|
||||
|
||||
|
||||
def basic_force_field_falloff_ui(self, field):
|
||||
layout = self.layout
|
||||
split = layout.split(percentage=0.35)
|
||||
|
||||
if not field or field.type == 'NONE':
|
||||
return
|
||||
|
||||
col = split.column()
|
||||
col.itemR(field, "z_direction", text="")
|
||||
col.itemR(field, "use_min_distance", text="Use Minimum")
|
||||
col.itemR(field, "use_max_distance", text="Use Maximum")
|
||||
layout = self.layout
|
||||
layout.set_context_pointer("PointCache", cache)
|
||||
|
||||
col = split.column()
|
||||
col.itemR(field, "falloff_power", text="Power")
|
||||
|
||||
sub = col.column()
|
||||
sub.active = field.use_min_distance
|
||||
sub.itemR(field, "minimum_distance", text="Distance")
|
||||
|
||||
sub = col.column()
|
||||
sub.active = field.use_max_distance
|
||||
sub.itemR(field, "maximum_distance", text="Distance")
|
||||
row = layout.row()
|
||||
row.template_list(cache, "point_cache_list", cache, "active_point_cache_index", rows=2 )
|
||||
col = row.column(align=True)
|
||||
col.itemO("ptcache.add_new", icon='ICON_ZOOMIN', text="")
|
||||
col.itemO("ptcache.remove", icon='ICON_ZOOMOUT', text="")
|
||||
|
||||
row = layout.row()
|
||||
row.itemL(text="File Name:")
|
||||
if particles:
|
||||
row.itemR(cache, "external")
|
||||
|
||||
if cache.external:
|
||||
split = layout.split(percentage=0.80)
|
||||
split.itemR(cache, "name", text="")
|
||||
split.itemR(cache, "index", text="")
|
||||
|
||||
layout.itemL(text="File Path:")
|
||||
layout.itemR(cache, "filepath", text="")
|
||||
|
||||
layout.itemL(text=cache.info)
|
||||
else:
|
||||
layout.itemR(cache, "name", text="")
|
||||
|
||||
if not particles:
|
||||
row = layout.row()
|
||||
row.enabled = enabled
|
||||
row.itemR(cache, "start_frame")
|
||||
row.itemR(cache, "end_frame")
|
||||
|
||||
row = layout.row()
|
||||
|
||||
if cache.baked == True:
|
||||
row.itemO("ptcache.free_bake", text="Free Bake")
|
||||
else:
|
||||
row.item_booleanO("ptcache.bake", "bake", True, text="Bake")
|
||||
|
||||
sub = row.row()
|
||||
sub.enabled = (cache.frames_skipped or cache.outdated) and enabled
|
||||
sub.itemO("ptcache.bake", "bake", False, text="Calculate to Current Frame")
|
||||
|
||||
row = layout.row()
|
||||
row.enabled = enabled
|
||||
row.itemO("ptcache.bake_from_cache", text="Current Cache to Bake")
|
||||
if not smoke:
|
||||
row.itemR(cache, "step");
|
||||
|
||||
if not smoke:
|
||||
row = layout.row()
|
||||
sub = row.row()
|
||||
sub.enabled = enabled
|
||||
sub.itemR(cache, "quick_cache")
|
||||
row.itemR(cache, "disk_cache")
|
||||
|
||||
layout.itemL(text=cache.info)
|
||||
|
||||
layout.itemS()
|
||||
|
||||
row = layout.row()
|
||||
row.item_booleanO("ptcache.bake_all", "bake", True, text="Bake All Dynamics")
|
||||
row.itemO("ptcache.free_bake_all", text="Free All Bakes")
|
||||
layout.itemO("ptcache.bake_all", "bake", False, text="Update All Dynamics to current frame")
|
||||
|
||||
def effector_weights_ui(self, weights):
|
||||
layout = self.layout
|
||||
|
||||
layout.itemR(weights, "group")
|
||||
|
||||
split = layout.split()
|
||||
split.itemR(weights, "gravity", slider=True)
|
||||
split.itemR(weights, "all", slider=True)
|
||||
|
||||
layout.itemS()
|
||||
|
||||
flow = layout.column_flow()
|
||||
flow.itemR(weights, "force", slider=True)
|
||||
flow.itemR(weights, "vortex", slider=True)
|
||||
flow.itemR(weights, "magnetic", slider=True)
|
||||
flow.itemR(weights, "wind", slider=True)
|
||||
flow.itemR(weights, "curveguide", slider=True)
|
||||
flow.itemR(weights, "texture", slider=True)
|
||||
flow.itemR(weights, "harmonic", slider=True)
|
||||
flow.itemR(weights, "charge", slider=True)
|
||||
flow.itemR(weights, "lennardjones", slider=True)
|
||||
flow.itemR(weights, "turbulence", slider=True)
|
||||
flow.itemR(weights, "drag", slider=True)
|
||||
flow.itemR(weights, "boid", slider=True)
|
||||
|
||||
def basic_force_field_settings_ui(self, field):
|
||||
layout = self.layout
|
||||
split = layout.split()
|
||||
|
||||
if not field or field.type == 'NONE':
|
||||
return
|
||||
|
||||
col = split.column()
|
||||
|
||||
if field.type == 'DRAG':
|
||||
col.itemR(field, "linear_drag", text="Linear")
|
||||
else:
|
||||
col.itemR(field, "strength")
|
||||
|
||||
if field.type == 'TURBULENCE':
|
||||
col.itemR(field, "size")
|
||||
col.itemR(field, "flow")
|
||||
elif field.type == 'HARMONIC':
|
||||
col.itemR(field, "harmonic_damping", text="Damping")
|
||||
elif field.type == 'VORTEX' and field.shape != 'POINT':
|
||||
col.itemR(field, "inflow")
|
||||
elif field.type == 'DRAG':
|
||||
col.itemR(field, "quadratic_drag", text="Quadratic")
|
||||
else:
|
||||
col.itemR(field, "flow")
|
||||
|
||||
col = split.column()
|
||||
col.itemR(field, "noise")
|
||||
col.itemR(field, "seed")
|
||||
if field.type == 'TURBULENCE':
|
||||
col.itemR(field, "global_coordinates", text="Global")
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Effect point:")
|
||||
col.itemR(field, "do_location")
|
||||
col.itemR(field, "do_rotation")
|
||||
|
||||
sub = split.column()
|
||||
sub.itemL(text="Collision:")
|
||||
sub.itemR(field, "do_absorption")
|
||||
|
||||
|
||||
def basic_force_field_falloff_ui(self, field):
|
||||
layout = self.layout
|
||||
split = layout.split(percentage=0.35)
|
||||
|
||||
if not field or field.type == 'NONE':
|
||||
return
|
||||
|
||||
col = split.column()
|
||||
col.itemR(field, "z_direction", text="")
|
||||
col.itemR(field, "use_min_distance", text="Use Minimum")
|
||||
col.itemR(field, "use_max_distance", text="Use Maximum")
|
||||
|
||||
col = split.column()
|
||||
col.itemR(field, "falloff_power", text="Power")
|
||||
|
||||
sub = col.column()
|
||||
sub.active = field.use_min_distance
|
||||
sub.itemR(field, "minimum_distance", text="Distance")
|
||||
|
||||
sub = col.column()
|
||||
sub.active = field.use_max_distance
|
||||
sub.itemR(field, "maximum_distance", text="Distance")
|
||||
|
@ -5,198 +5,198 @@ from buttons_physics_common import basic_force_field_settings_ui
|
||||
from buttons_physics_common import basic_force_field_falloff_ui
|
||||
|
||||
class PhysicButtonsPanel(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):
|
||||
rd = context.scene.render_data
|
||||
return (context.object) and (not rd.use_game_engine)
|
||||
|
||||
def poll(self, context):
|
||||
rd = context.scene.render_data
|
||||
return (context.object) and (not rd.use_game_engine)
|
||||
|
||||
class PHYSICS_PT_field(PhysicButtonsPanel):
|
||||
bl_label = "Force Fields"
|
||||
bl_label = "Force Fields"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
ob = context.object
|
||||
field = ob.field
|
||||
|
||||
split = layout.split(percentage=0.2)
|
||||
split.itemL(text="Type:")
|
||||
split.itemR(field, "type",text="")
|
||||
|
||||
if field.type not in ('NONE', 'GUIDE', 'TEXTURE'):
|
||||
split = layout.split(percentage=0.2)
|
||||
#split = layout.row()
|
||||
split.itemL(text="Shape:")
|
||||
split.itemR(field, "shape", text="")
|
||||
|
||||
split = layout.split()
|
||||
|
||||
if field.type == 'NONE':
|
||||
return # nothing to draw
|
||||
elif field.type == 'GUIDE':
|
||||
col = split.column()
|
||||
col.itemR(field, "guide_minimum")
|
||||
col.itemR(field, "guide_free")
|
||||
col.itemR(field, "falloff_power")
|
||||
col.itemR(field, "guide_path_add")
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Clumping:")
|
||||
col.itemR(field, "guide_clump_amount")
|
||||
col.itemR(field, "guide_clump_shape")
|
||||
|
||||
row = layout.row()
|
||||
row.itemR(field, "use_max_distance")
|
||||
sub = row.row()
|
||||
sub.active = field.use_max_distance
|
||||
sub.itemR(field, "maximum_distance")
|
||||
|
||||
layout.itemS()
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
layout.itemR(field, "guide_kink_type")
|
||||
if (field.guide_kink_type != "NONE"):
|
||||
layout.itemR(field, "guide_kink_axis")
|
||||
|
||||
flow = layout.column_flow()
|
||||
flow.itemR(field, "guide_kink_frequency")
|
||||
flow.itemR(field, "guide_kink_shape")
|
||||
flow.itemR(field, "guide_kink_amplitude")
|
||||
ob = context.object
|
||||
field = ob.field
|
||||
|
||||
elif field.type == 'TEXTURE':
|
||||
col = split.column()
|
||||
col.itemR(field, "strength")
|
||||
col.itemR(field, "texture", text="")
|
||||
col.itemR(field, "texture_mode", text="")
|
||||
col.itemR(field, "texture_nabla")
|
||||
|
||||
col = split.column()
|
||||
col.itemR(field, "use_coordinates")
|
||||
col.itemR(field, "root_coordinates")
|
||||
col.itemR(field, "force_2d")
|
||||
split = layout.split(percentage=0.2)
|
||||
split.itemL(text="Type:")
|
||||
split.itemR(field, "type",text="")
|
||||
|
||||
else :
|
||||
basic_force_field_settings_ui(self, field)
|
||||
|
||||
if field.type not in ('NONE', 'GUIDE'):
|
||||
|
||||
layout.itemL(text="Falloff:")
|
||||
layout.itemR(field, "falloff_type", expand=True)
|
||||
if field.type not in ('NONE', 'GUIDE', 'TEXTURE'):
|
||||
split = layout.split(percentage=0.2)
|
||||
#split = layout.row()
|
||||
split.itemL(text="Shape:")
|
||||
split.itemR(field, "shape", text="")
|
||||
|
||||
basic_force_field_falloff_ui(self, field)
|
||||
|
||||
if field.falloff_type == 'CONE':
|
||||
layout.itemS()
|
||||
|
||||
split = layout.split(percentage=0.35)
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Angular:")
|
||||
col.itemR(field, "use_radial_min", text="Use Minimum")
|
||||
col.itemR(field, "use_radial_max", text="Use Maximum")
|
||||
|
||||
col = split.column()
|
||||
col.itemR(field, "radial_falloff", text="Power")
|
||||
|
||||
sub = col.column()
|
||||
sub.active = field.use_radial_min
|
||||
sub.itemR(field, "radial_minimum", text="Angle")
|
||||
|
||||
sub = col.column()
|
||||
sub.active = field.use_radial_max
|
||||
sub.itemR(field, "radial_maximum", text="Angle")
|
||||
|
||||
elif field.falloff_type == 'TUBE':
|
||||
layout.itemS()
|
||||
|
||||
split = layout.split(percentage=0.35)
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Radial:")
|
||||
col.itemR(field, "use_radial_min", text="Use Minimum")
|
||||
col.itemR(field, "use_radial_max", text="Use Maximum")
|
||||
|
||||
col = split.column()
|
||||
col.itemR(field, "radial_falloff", text="Power")
|
||||
|
||||
sub = col.column()
|
||||
sub.active = field.use_radial_min
|
||||
sub.itemR(field, "radial_minimum", text="Distance")
|
||||
|
||||
sub = col.column()
|
||||
sub.active = field.use_radial_max
|
||||
sub.itemR(field, "radial_maximum", text="Distance")
|
||||
split = layout.split()
|
||||
|
||||
if field.type == 'NONE':
|
||||
return # nothing to draw
|
||||
elif field.type == 'GUIDE':
|
||||
col = split.column()
|
||||
col.itemR(field, "guide_minimum")
|
||||
col.itemR(field, "guide_free")
|
||||
col.itemR(field, "falloff_power")
|
||||
col.itemR(field, "guide_path_add")
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Clumping:")
|
||||
col.itemR(field, "guide_clump_amount")
|
||||
col.itemR(field, "guide_clump_shape")
|
||||
|
||||
row = layout.row()
|
||||
row.itemR(field, "use_max_distance")
|
||||
sub = row.row()
|
||||
sub.active = field.use_max_distance
|
||||
sub.itemR(field, "maximum_distance")
|
||||
|
||||
layout.itemS()
|
||||
|
||||
layout.itemR(field, "guide_kink_type")
|
||||
if (field.guide_kink_type != "NONE"):
|
||||
layout.itemR(field, "guide_kink_axis")
|
||||
|
||||
flow = layout.column_flow()
|
||||
flow.itemR(field, "guide_kink_frequency")
|
||||
flow.itemR(field, "guide_kink_shape")
|
||||
flow.itemR(field, "guide_kink_amplitude")
|
||||
|
||||
elif field.type == 'TEXTURE':
|
||||
col = split.column()
|
||||
col.itemR(field, "strength")
|
||||
col.itemR(field, "texture", text="")
|
||||
col.itemR(field, "texture_mode", text="")
|
||||
col.itemR(field, "texture_nabla")
|
||||
|
||||
col = split.column()
|
||||
col.itemR(field, "use_coordinates")
|
||||
col.itemR(field, "root_coordinates")
|
||||
col.itemR(field, "force_2d")
|
||||
|
||||
else :
|
||||
basic_force_field_settings_ui(self, field)
|
||||
|
||||
if field.type not in ('NONE', 'GUIDE'):
|
||||
|
||||
layout.itemL(text="Falloff:")
|
||||
layout.itemR(field, "falloff_type", expand=True)
|
||||
|
||||
basic_force_field_falloff_ui(self, field)
|
||||
|
||||
if field.falloff_type == 'CONE':
|
||||
layout.itemS()
|
||||
|
||||
split = layout.split(percentage=0.35)
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Angular:")
|
||||
col.itemR(field, "use_radial_min", text="Use Minimum")
|
||||
col.itemR(field, "use_radial_max", text="Use Maximum")
|
||||
|
||||
col = split.column()
|
||||
col.itemR(field, "radial_falloff", text="Power")
|
||||
|
||||
sub = col.column()
|
||||
sub.active = field.use_radial_min
|
||||
sub.itemR(field, "radial_minimum", text="Angle")
|
||||
|
||||
sub = col.column()
|
||||
sub.active = field.use_radial_max
|
||||
sub.itemR(field, "radial_maximum", text="Angle")
|
||||
|
||||
elif field.falloff_type == 'TUBE':
|
||||
layout.itemS()
|
||||
|
||||
split = layout.split(percentage=0.35)
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Radial:")
|
||||
col.itemR(field, "use_radial_min", text="Use Minimum")
|
||||
col.itemR(field, "use_radial_max", text="Use Maximum")
|
||||
|
||||
col = split.column()
|
||||
col.itemR(field, "radial_falloff", text="Power")
|
||||
|
||||
sub = col.column()
|
||||
sub.active = field.use_radial_min
|
||||
sub.itemR(field, "radial_minimum", text="Distance")
|
||||
|
||||
sub = col.column()
|
||||
sub.active = field.use_radial_max
|
||||
sub.itemR(field, "radial_maximum", text="Distance")
|
||||
|
||||
class PHYSICS_PT_collision(PhysicButtonsPanel):
|
||||
bl_label = "Collision"
|
||||
#bl_default_closed = True
|
||||
|
||||
def poll(self, context):
|
||||
ob = context.object
|
||||
rd = context.scene.render_data
|
||||
return (ob and ob.type == 'MESH') and (not rd.use_game_engine)
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
md = context.collision
|
||||
bl_label = "Collision"
|
||||
#bl_default_closed = True
|
||||
|
||||
split = layout.split()
|
||||
split.operator_context = 'EXEC_DEFAULT'
|
||||
def poll(self, context):
|
||||
ob = context.object
|
||||
rd = context.scene.render_data
|
||||
return (ob and ob.type == 'MESH') and (not rd.use_game_engine)
|
||||
|
||||
if md:
|
||||
# remove modifier + settings
|
||||
split.set_context_pointer("modifier", md)
|
||||
split.itemO("object.modifier_remove", text="Remove")
|
||||
col = split.column()
|
||||
|
||||
#row = split.row(align=True)
|
||||
#row.itemR(md, "render", text="")
|
||||
#row.itemR(md, "realtime", text="")
|
||||
|
||||
coll = md.settings
|
||||
|
||||
else:
|
||||
# add modifier
|
||||
split.item_enumO("object.modifier_add", "type", 'COLLISION', text="Add")
|
||||
split.itemL()
|
||||
|
||||
coll = None
|
||||
|
||||
if coll:
|
||||
settings = context.object.collision
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
md = context.collision
|
||||
|
||||
split = layout.split()
|
||||
split.operator_context = 'EXEC_DEFAULT'
|
||||
|
||||
if md:
|
||||
# remove modifier + settings
|
||||
split.set_context_pointer("modifier", md)
|
||||
split.itemO("object.modifier_remove", text="Remove")
|
||||
col = split.column()
|
||||
|
||||
#row = split.row(align=True)
|
||||
#row.itemR(md, "render", text="")
|
||||
#row.itemR(md, "realtime", text="")
|
||||
|
||||
coll = md.settings
|
||||
|
||||
else:
|
||||
# add modifier
|
||||
split.item_enumO("object.modifier_add", "type", 'COLLISION', text="Add")
|
||||
split.itemL()
|
||||
|
||||
coll = None
|
||||
|
||||
if coll:
|
||||
settings = context.object.collision
|
||||
|
||||
layout.active = settings.enabled
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Particle:")
|
||||
col.itemR(settings, "permeability", slider=True)
|
||||
col.itemL(text="Particle Damping:")
|
||||
sub = col.column(align=True)
|
||||
sub.itemR(settings, "damping_factor", text="Factor", slider=True)
|
||||
sub.itemR(settings, "random_damping", text="Random", slider=True)
|
||||
|
||||
col.itemL(text="Soft Body and Cloth:")
|
||||
sub = col.column(align=True)
|
||||
sub.itemR(settings, "outer_thickness", text="Outer", slider=True)
|
||||
sub.itemR(settings, "inner_thickness", text="Inner", slider=True)
|
||||
|
||||
layout.itemL(text="Force Fields:")
|
||||
layout.itemR(settings, "absorption", text="Absorption")
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="")
|
||||
col.itemR(settings, "kill_particles")
|
||||
col.itemL(text="Particle Friction:")
|
||||
sub = col.column(align=True)
|
||||
sub.itemR(settings, "friction_factor", text="Factor", slider=True)
|
||||
sub.itemR(settings, "random_friction", text="Random", slider=True)
|
||||
col.itemL(text="Soft Body Damping:")
|
||||
col.itemR(settings, "damping", text="Factor", slider=True)
|
||||
|
||||
layout.active = settings.enabled
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Particle:")
|
||||
col.itemR(settings, "permeability", slider=True)
|
||||
col.itemL(text="Particle Damping:")
|
||||
sub = col.column(align=True)
|
||||
sub.itemR(settings, "damping_factor", text="Factor", slider=True)
|
||||
sub.itemR(settings, "random_damping", text="Random", slider=True)
|
||||
|
||||
col.itemL(text="Soft Body and Cloth:")
|
||||
sub = col.column(align=True)
|
||||
sub.itemR(settings, "outer_thickness", text="Outer", slider=True)
|
||||
sub.itemR(settings, "inner_thickness", text="Inner", slider=True)
|
||||
|
||||
layout.itemL(text="Force Fields:")
|
||||
layout.itemR(settings, "absorption", text="Absorption")
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="")
|
||||
col.itemR(settings, "kill_particles")
|
||||
col.itemL(text="Particle Friction:")
|
||||
sub = col.column(align=True)
|
||||
sub.itemR(settings, "friction_factor", text="Factor", slider=True)
|
||||
sub.itemR(settings, "random_friction", text="Random", slider=True)
|
||||
col.itemL(text="Soft Body Damping:")
|
||||
col.itemR(settings, "damping", text="Factor", slider=True)
|
||||
|
||||
bpy.types.register(PHYSICS_PT_field)
|
||||
bpy.types.register(PHYSICS_PT_collision)
|
||||
|
@ -2,254 +2,254 @@
|
||||
import bpy
|
||||
|
||||
class PhysicButtonsPanel(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.object
|
||||
rd = context.scene.render_data
|
||||
return (ob and ob.type == 'MESH') and (not rd.use_game_engine)
|
||||
|
||||
def poll(self, context):
|
||||
ob = context.object
|
||||
rd = context.scene.render_data
|
||||
return (ob and ob.type == 'MESH') and (not rd.use_game_engine)
|
||||
|
||||
class PHYSICS_PT_fluid(PhysicButtonsPanel):
|
||||
bl_label = "Fluid"
|
||||
bl_label = "Fluid"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
md = context.fluid
|
||||
ob = context.object
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
split = layout.split()
|
||||
split.operator_context = 'EXEC_DEFAULT'
|
||||
md = context.fluid
|
||||
ob = context.object
|
||||
|
||||
if md:
|
||||
# remove modifier + settings
|
||||
split.set_context_pointer("modifier", md)
|
||||
split.itemO("object.modifier_remove", text="Remove")
|
||||
split = layout.split()
|
||||
split.operator_context = 'EXEC_DEFAULT'
|
||||
|
||||
row = split.row(align=True)
|
||||
row.itemR(md, "render", text="")
|
||||
row.itemR(md, "realtime", text="")
|
||||
|
||||
fluid = md.settings
|
||||
|
||||
else:
|
||||
# add modifier
|
||||
split.item_enumO("object.modifier_add", "type", 'FLUID_SIMULATION', text="Add")
|
||||
split.itemL()
|
||||
|
||||
fluid = None
|
||||
|
||||
|
||||
if fluid:
|
||||
layout.itemR(fluid, "type")
|
||||
if md:
|
||||
# remove modifier + settings
|
||||
split.set_context_pointer("modifier", md)
|
||||
split.itemO("object.modifier_remove", text="Remove")
|
||||
|
||||
if fluid.type == 'DOMAIN':
|
||||
layout.itemO("fluid.bake", text="Bake Fluid Simulation", icon='ICON_MOD_FLUIDSIM')
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Resolution:")
|
||||
col.itemR(fluid, "resolution", text="Final")
|
||||
col.itemL(text="Render Display:")
|
||||
col.itemR(fluid, "render_display_mode", text="")
|
||||
col.itemL(text="Time:")
|
||||
sub = col.column(align=True)
|
||||
sub.itemR(fluid, "start_time", text="Start")
|
||||
sub.itemR(fluid, "end_time", text="End")
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Required Memory: " + fluid.memory_estimate)
|
||||
col.itemR(fluid, "preview_resolution", text="Preview")
|
||||
col.itemL(text="Viewport Display:")
|
||||
col.itemR(fluid, "viewport_display_mode", text="")
|
||||
col.itemL()
|
||||
col.itemR(fluid, "generate_speed_vectors")
|
||||
col.itemR(fluid, "reverse_frames")
|
||||
|
||||
layout.itemR(fluid, "path", text="")
|
||||
|
||||
elif fluid.type == 'FLUID':
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Volume Initialization:")
|
||||
col.itemR(fluid, "volume_initialization", text="")
|
||||
col.itemR(fluid, "export_animated_mesh")
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Initial Velocity:")
|
||||
col.itemR(fluid, "initial_velocity", text="")
|
||||
|
||||
elif fluid.type == 'OBSTACLE':
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Volume Initialization:")
|
||||
col.itemR(fluid, "volume_initialization", text="")
|
||||
col.itemR(fluid, "export_animated_mesh")
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Slip Type:")
|
||||
col.itemR(fluid, "slip_type", text="")
|
||||
if fluid.slip_type == 'PARTIALSLIP':
|
||||
col.itemR(fluid, "partial_slip_factor", slider=True, text="Amount")
|
||||
|
||||
col.itemL(text="Impact:")
|
||||
col.itemR(fluid, "impact_factor", text="Factor")
|
||||
|
||||
elif fluid.type == 'INFLOW':
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Volume Initialization:")
|
||||
col.itemR(fluid, "volume_initialization", text="")
|
||||
col.itemR(fluid, "export_animated_mesh")
|
||||
col.itemR(fluid, "local_coordinates")
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Inflow Velocity:")
|
||||
col.itemR(fluid, "inflow_velocity", text="")
|
||||
|
||||
elif fluid.type == 'OUTFLOW':
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Volume Initialization:")
|
||||
col.itemR(fluid, "volume_initialization", text="")
|
||||
col.itemR(fluid, "export_animated_mesh")
|
||||
|
||||
split.column()
|
||||
|
||||
elif fluid.type == 'PARTICLE':
|
||||
split = layout.split(percentage=0.5)
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Influence:")
|
||||
col.itemR(fluid, "particle_influence", text="Size")
|
||||
col.itemR(fluid, "alpha_influence", text="Alpha")
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Type:")
|
||||
col.itemR(fluid, "drops")
|
||||
col.itemR(fluid, "floats")
|
||||
col = split.column()
|
||||
col.itemL()
|
||||
col.itemR(fluid, "tracer")
|
||||
|
||||
layout.itemR(fluid, "path", text="")
|
||||
|
||||
elif fluid.type == 'CONTROL':
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="")
|
||||
col.itemR(fluid, "quality", slider=True)
|
||||
col.itemR(fluid, "reverse_frames")
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Time:")
|
||||
sub = col.column(align=True)
|
||||
sub.itemR(fluid, "start_time", text="Start")
|
||||
sub.itemR(fluid, "end_time", text="End")
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Attraction Force:")
|
||||
sub = col.column(align=True)
|
||||
sub.itemR(fluid, "attraction_strength", text="Strength")
|
||||
sub.itemR(fluid, "attraction_radius", text="Radius")
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Velocity Force:")
|
||||
sub = col.column(align=True)
|
||||
sub.itemR(fluid, "velocity_strength", text="Strength")
|
||||
sub.itemR(fluid, "velocity_radius", text="Radius")
|
||||
row = split.row(align=True)
|
||||
row.itemR(md, "render", text="")
|
||||
row.itemR(md, "realtime", text="")
|
||||
|
||||
fluid = md.settings
|
||||
|
||||
else:
|
||||
# add modifier
|
||||
split.item_enumO("object.modifier_add", "type", 'FLUID_SIMULATION', text="Add")
|
||||
split.itemL()
|
||||
|
||||
fluid = None
|
||||
|
||||
|
||||
if fluid:
|
||||
layout.itemR(fluid, "type")
|
||||
|
||||
if fluid.type == 'DOMAIN':
|
||||
layout.itemO("fluid.bake", text="Bake Fluid Simulation", icon='ICON_MOD_FLUIDSIM')
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Resolution:")
|
||||
col.itemR(fluid, "resolution", text="Final")
|
||||
col.itemL(text="Render Display:")
|
||||
col.itemR(fluid, "render_display_mode", text="")
|
||||
col.itemL(text="Time:")
|
||||
sub = col.column(align=True)
|
||||
sub.itemR(fluid, "start_time", text="Start")
|
||||
sub.itemR(fluid, "end_time", text="End")
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Required Memory: " + fluid.memory_estimate)
|
||||
col.itemR(fluid, "preview_resolution", text="Preview")
|
||||
col.itemL(text="Viewport Display:")
|
||||
col.itemR(fluid, "viewport_display_mode", text="")
|
||||
col.itemL()
|
||||
col.itemR(fluid, "generate_speed_vectors")
|
||||
col.itemR(fluid, "reverse_frames")
|
||||
|
||||
layout.itemR(fluid, "path", text="")
|
||||
|
||||
elif fluid.type == 'FLUID':
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Volume Initialization:")
|
||||
col.itemR(fluid, "volume_initialization", text="")
|
||||
col.itemR(fluid, "export_animated_mesh")
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Initial Velocity:")
|
||||
col.itemR(fluid, "initial_velocity", text="")
|
||||
|
||||
elif fluid.type == 'OBSTACLE':
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Volume Initialization:")
|
||||
col.itemR(fluid, "volume_initialization", text="")
|
||||
col.itemR(fluid, "export_animated_mesh")
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Slip Type:")
|
||||
col.itemR(fluid, "slip_type", text="")
|
||||
if fluid.slip_type == 'PARTIALSLIP':
|
||||
col.itemR(fluid, "partial_slip_factor", slider=True, text="Amount")
|
||||
|
||||
col.itemL(text="Impact:")
|
||||
col.itemR(fluid, "impact_factor", text="Factor")
|
||||
|
||||
elif fluid.type == 'INFLOW':
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Volume Initialization:")
|
||||
col.itemR(fluid, "volume_initialization", text="")
|
||||
col.itemR(fluid, "export_animated_mesh")
|
||||
col.itemR(fluid, "local_coordinates")
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Inflow Velocity:")
|
||||
col.itemR(fluid, "inflow_velocity", text="")
|
||||
|
||||
elif fluid.type == 'OUTFLOW':
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Volume Initialization:")
|
||||
col.itemR(fluid, "volume_initialization", text="")
|
||||
col.itemR(fluid, "export_animated_mesh")
|
||||
|
||||
split.column()
|
||||
|
||||
elif fluid.type == 'PARTICLE':
|
||||
split = layout.split(percentage=0.5)
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Influence:")
|
||||
col.itemR(fluid, "particle_influence", text="Size")
|
||||
col.itemR(fluid, "alpha_influence", text="Alpha")
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Type:")
|
||||
col.itemR(fluid, "drops")
|
||||
col.itemR(fluid, "floats")
|
||||
col = split.column()
|
||||
col.itemL()
|
||||
col.itemR(fluid, "tracer")
|
||||
|
||||
layout.itemR(fluid, "path", text="")
|
||||
|
||||
elif fluid.type == 'CONTROL':
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="")
|
||||
col.itemR(fluid, "quality", slider=True)
|
||||
col.itemR(fluid, "reverse_frames")
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Time:")
|
||||
sub = col.column(align=True)
|
||||
sub.itemR(fluid, "start_time", text="Start")
|
||||
sub.itemR(fluid, "end_time", text="End")
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Attraction Force:")
|
||||
sub = col.column(align=True)
|
||||
sub.itemR(fluid, "attraction_strength", text="Strength")
|
||||
sub.itemR(fluid, "attraction_radius", text="Radius")
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Velocity Force:")
|
||||
sub = col.column(align=True)
|
||||
sub.itemR(fluid, "velocity_strength", text="Strength")
|
||||
sub.itemR(fluid, "velocity_radius", text="Radius")
|
||||
|
||||
class PHYSICS_PT_domain_gravity(PhysicButtonsPanel):
|
||||
bl_label = "Domain World"
|
||||
bl_default_closed = True
|
||||
|
||||
def poll(self, context):
|
||||
md = context.fluid
|
||||
return md and (md.settings.type == 'DOMAIN')
|
||||
bl_label = "Domain World"
|
||||
bl_default_closed = True
|
||||
|
||||
def poll(self, context):
|
||||
md = context.fluid
|
||||
return md and (md.settings.type == 'DOMAIN')
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
fluid = context.fluid.settings
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Gravity:")
|
||||
col.itemR(fluid, "gravity", text="")
|
||||
col.itemL(text="Real World Size:")
|
||||
col.itemR(fluid, "real_world_size", text="Metres")
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Viscosity Presets:")
|
||||
sub = col.column(align=True)
|
||||
sub.itemR(fluid, "viscosity_preset", text="")
|
||||
|
||||
if fluid.viscosity_preset == 'MANUAL':
|
||||
sub.itemR(fluid, "viscosity_base", text="Base")
|
||||
sub.itemR(fluid, "viscosity_exponent", text="Exponent", slider=True)
|
||||
else:
|
||||
sub.itemL()
|
||||
sub.itemL()
|
||||
|
||||
col.itemL(text="Optimization:")
|
||||
sub = col.column(align=True)
|
||||
sub.itemR(fluid, "grid_levels", slider=True)
|
||||
sub.itemR(fluid, "compressibility", slider=True)
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
fluid = context.fluid.settings
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Gravity:")
|
||||
col.itemR(fluid, "gravity", text="")
|
||||
col.itemL(text="Real World Size:")
|
||||
col.itemR(fluid, "real_world_size", text="Metres")
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Viscosity Presets:")
|
||||
sub = col.column(align=True)
|
||||
sub.itemR(fluid, "viscosity_preset", text="")
|
||||
|
||||
if fluid.viscosity_preset == 'MANUAL':
|
||||
sub.itemR(fluid, "viscosity_base", text="Base")
|
||||
sub.itemR(fluid, "viscosity_exponent", text="Exponent", slider=True)
|
||||
else:
|
||||
sub.itemL()
|
||||
sub.itemL()
|
||||
|
||||
col.itemL(text="Optimization:")
|
||||
sub = col.column(align=True)
|
||||
sub.itemR(fluid, "grid_levels", slider=True)
|
||||
sub.itemR(fluid, "compressibility", slider=True)
|
||||
|
||||
class PHYSICS_PT_domain_boundary(PhysicButtonsPanel):
|
||||
bl_label = "Domain Boundary"
|
||||
bl_default_closed = True
|
||||
|
||||
def poll(self, context):
|
||||
md = context.fluid
|
||||
return md and (md.settings.type == 'DOMAIN')
|
||||
bl_label = "Domain Boundary"
|
||||
bl_default_closed = True
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
fluid = context.fluid.settings
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Slip Type:")
|
||||
sub = col.column(align=True)
|
||||
sub.itemR(fluid, "slip_type", text="")
|
||||
if fluid.slip_type == 'PARTIALSLIP':
|
||||
sub.itemR(fluid, "partial_slip_factor", slider=True, text="Amount")
|
||||
def poll(self, context):
|
||||
md = context.fluid
|
||||
return md and (md.settings.type == 'DOMAIN')
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
fluid = context.fluid.settings
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Slip Type:")
|
||||
sub = col.column(align=True)
|
||||
sub.itemR(fluid, "slip_type", text="")
|
||||
if fluid.slip_type == 'PARTIALSLIP':
|
||||
sub.itemR(fluid, "partial_slip_factor", slider=True, text="Amount")
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Surface:")
|
||||
sub = col.column(align=True)
|
||||
sub.itemR(fluid, "surface_smoothing", text="Smoothing")
|
||||
sub.itemR(fluid, "surface_subdivisions", text="Subdivisions")
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Surface:")
|
||||
sub = col.column(align=True)
|
||||
sub.itemR(fluid, "surface_smoothing", text="Smoothing")
|
||||
sub.itemR(fluid, "surface_subdivisions", text="Subdivisions")
|
||||
|
||||
class PHYSICS_PT_domain_particles(PhysicButtonsPanel):
|
||||
bl_label = "Domain Particles"
|
||||
bl_default_closed = True
|
||||
|
||||
def poll(self, context):
|
||||
md = context.fluid
|
||||
return md and (md.settings.type == 'DOMAIN')
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
fluid = context.fluid.settings
|
||||
|
||||
col = layout.column(align=True)
|
||||
col.itemR(fluid, "tracer_particles")
|
||||
col.itemR(fluid, "generate_particles")
|
||||
bl_label = "Domain Particles"
|
||||
bl_default_closed = True
|
||||
|
||||
def poll(self, context):
|
||||
md = context.fluid
|
||||
return md and (md.settings.type == 'DOMAIN')
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
fluid = context.fluid.settings
|
||||
|
||||
col = layout.column(align=True)
|
||||
col.itemR(fluid, "tracer_particles")
|
||||
col.itemR(fluid, "generate_particles")
|
||||
|
||||
bpy.types.register(PHYSICS_PT_fluid)
|
||||
bpy.types.register(PHYSICS_PT_domain_gravity)
|
||||
|
@ -5,186 +5,186 @@ from buttons_physics_common import point_cache_ui
|
||||
from buttons_physics_common import effector_weights_ui
|
||||
|
||||
class PhysicButtonsPanel(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.object
|
||||
rd = context.scene.render_data
|
||||
return (ob and ob.type == 'MESH') and (not rd.use_game_engine)
|
||||
|
||||
def poll(self, context):
|
||||
ob = context.object
|
||||
rd = context.scene.render_data
|
||||
return (ob and ob.type == 'MESH') and (not rd.use_game_engine)
|
||||
|
||||
class PHYSICS_PT_smoke(PhysicButtonsPanel):
|
||||
bl_label = "Smoke"
|
||||
bl_label = "Smoke"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
md = context.smoke
|
||||
ob = context.object
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
split = layout.split()
|
||||
split.operator_context = 'EXEC_DEFAULT'
|
||||
md = context.smoke
|
||||
ob = context.object
|
||||
|
||||
if md:
|
||||
# remove modifier + settings
|
||||
split.set_context_pointer("modifier", md)
|
||||
split.itemO("object.modifier_remove", text="Remove")
|
||||
split = layout.split()
|
||||
split.operator_context = 'EXEC_DEFAULT'
|
||||
|
||||
row = split.row(align=True)
|
||||
row.itemR(md, "render", text="")
|
||||
row.itemR(md, "realtime", text="")
|
||||
|
||||
else:
|
||||
# add modifier
|
||||
split.item_enumO("object.modifier_add", "type", 'SMOKE', text="Add")
|
||||
split.itemL()
|
||||
if md:
|
||||
# remove modifier + settings
|
||||
split.set_context_pointer("modifier", md)
|
||||
split.itemO("object.modifier_remove", text="Remove")
|
||||
|
||||
if md:
|
||||
layout.itemR(md, "smoke_type", expand=True)
|
||||
|
||||
if md.smoke_type == 'TYPE_DOMAIN':
|
||||
|
||||
domain = md.domain_settings
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Resolution:")
|
||||
col.itemR(domain, "maxres", text="Divisions")
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Behavior:")
|
||||
col.itemR(domain, "alpha")
|
||||
col.itemR(domain, "beta")
|
||||
col.itemR(domain, "dissolve_smoke", text="Dissolve")
|
||||
sub = col.column()
|
||||
sub.active = domain.dissolve_smoke
|
||||
sub.itemR(domain, "dissolve_speed", text="Time")
|
||||
sub.itemR(domain, "dissolve_smoke_log", text="Slow")
|
||||
|
||||
elif md.smoke_type == 'TYPE_FLOW':
|
||||
|
||||
flow = md.flow_settings
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.itemR(flow, "outflow")
|
||||
col.itemL(text="Particle System:")
|
||||
col.item_pointerR(flow, "psys", ob, "particle_systems", text="")
|
||||
|
||||
if md.flow_settings.outflow:
|
||||
col = split.column()
|
||||
else:
|
||||
col = split.column()
|
||||
col.itemL(text="Behavior:")
|
||||
col.itemR(flow, "temperature")
|
||||
col.itemR(flow, "density")
|
||||
|
||||
#elif md.smoke_type == 'TYPE_COLL':
|
||||
# layout.itemS()
|
||||
row = split.row(align=True)
|
||||
row.itemR(md, "render", text="")
|
||||
row.itemR(md, "realtime", text="")
|
||||
|
||||
else:
|
||||
# add modifier
|
||||
split.item_enumO("object.modifier_add", "type", 'SMOKE', text="Add")
|
||||
split.itemL()
|
||||
|
||||
if md:
|
||||
layout.itemR(md, "smoke_type", expand=True)
|
||||
|
||||
if md.smoke_type == 'TYPE_DOMAIN':
|
||||
|
||||
domain = md.domain_settings
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Resolution:")
|
||||
col.itemR(domain, "maxres", text="Divisions")
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Behavior:")
|
||||
col.itemR(domain, "alpha")
|
||||
col.itemR(domain, "beta")
|
||||
col.itemR(domain, "dissolve_smoke", text="Dissolve")
|
||||
sub = col.column()
|
||||
sub.active = domain.dissolve_smoke
|
||||
sub.itemR(domain, "dissolve_speed", text="Time")
|
||||
sub.itemR(domain, "dissolve_smoke_log", text="Slow")
|
||||
|
||||
elif md.smoke_type == 'TYPE_FLOW':
|
||||
|
||||
flow = md.flow_settings
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.itemR(flow, "outflow")
|
||||
col.itemL(text="Particle System:")
|
||||
col.item_pointerR(flow, "psys", ob, "particle_systems", text="")
|
||||
|
||||
if md.flow_settings.outflow:
|
||||
col = split.column()
|
||||
else:
|
||||
col = split.column()
|
||||
col.itemL(text="Behavior:")
|
||||
col.itemR(flow, "temperature")
|
||||
col.itemR(flow, "density")
|
||||
|
||||
#elif md.smoke_type == 'TYPE_COLL':
|
||||
# layout.itemS()
|
||||
|
||||
class PHYSICS_PT_smoke_groups(PhysicButtonsPanel):
|
||||
bl_label = "Smoke Groups"
|
||||
bl_default_closed = True
|
||||
|
||||
def poll(self, context):
|
||||
md = context.smoke
|
||||
return md and (md.smoke_type == 'TYPE_DOMAIN')
|
||||
bl_label = "Smoke Groups"
|
||||
bl_default_closed = True
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
group = context.smoke.domain_settings
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Flow Group:")
|
||||
col.itemR(group, "fluid_group", text="")
|
||||
|
||||
#col.itemL(text="Effector Group:")
|
||||
#col.itemR(group, "eff_group", text="")
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Collision Group:")
|
||||
col.itemR(group, "coll_group", text="")
|
||||
def poll(self, context):
|
||||
md = context.smoke
|
||||
return md and (md.smoke_type == 'TYPE_DOMAIN')
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
group = context.smoke.domain_settings
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Flow Group:")
|
||||
col.itemR(group, "fluid_group", text="")
|
||||
|
||||
#col.itemL(text="Effector Group:")
|
||||
#col.itemR(group, "eff_group", text="")
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Collision Group:")
|
||||
col.itemR(group, "coll_group", text="")
|
||||
|
||||
class PHYSICS_PT_smoke_cache(PhysicButtonsPanel):
|
||||
bl_label = "Smoke Cache"
|
||||
bl_default_closed = True
|
||||
bl_label = "Smoke Cache"
|
||||
bl_default_closed = True
|
||||
|
||||
def poll(self, context):
|
||||
md = context.smoke
|
||||
return md and (md.smoke_type == 'TYPE_DOMAIN')
|
||||
def poll(self, context):
|
||||
md = context.smoke
|
||||
return md and (md.smoke_type == 'TYPE_DOMAIN')
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
md = context.smoke.domain_settings
|
||||
cache = md.point_cache_low
|
||||
|
||||
point_cache_ui(self, cache, cache.baked==False, 0, 1)
|
||||
|
||||
md = context.smoke.domain_settings
|
||||
cache = md.point_cache_low
|
||||
|
||||
point_cache_ui(self, cache, cache.baked==False, 0, 1)
|
||||
|
||||
class PHYSICS_PT_smoke_highres(PhysicButtonsPanel):
|
||||
bl_label = "Smoke High Resolution"
|
||||
bl_default_closed = True
|
||||
|
||||
def poll(self, context):
|
||||
md = context.smoke
|
||||
return md and (md.smoke_type == 'TYPE_DOMAIN')
|
||||
bl_label = "Smoke High Resolution"
|
||||
bl_default_closed = True
|
||||
|
||||
def draw_header(self, context):
|
||||
high = context.smoke.domain_settings
|
||||
|
||||
self.layout.itemR(high, "highres", text="")
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
md = context.smoke.domain_settings
|
||||
def poll(self, context):
|
||||
md = context.smoke
|
||||
return md and (md.smoke_type == 'TYPE_DOMAIN')
|
||||
|
||||
def draw_header(self, context):
|
||||
high = context.smoke.domain_settings
|
||||
|
||||
self.layout.itemR(high, "highres", text="")
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
md = context.smoke.domain_settings
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Resolution:")
|
||||
col.itemR(md, "amplify", text="Divisions")
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Noise Method:")
|
||||
col.row().itemR(md, "noise_type", text="")
|
||||
col.itemR(md, "strength")
|
||||
col.itemR(md, "viewhighres")
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Resolution:")
|
||||
col.itemR(md, "amplify", text="Divisions")
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Noise Method:")
|
||||
col.row().itemR(md, "noise_type", text="")
|
||||
col.itemR(md, "strength")
|
||||
col.itemR(md, "viewhighres")
|
||||
|
||||
class PHYSICS_PT_smoke_cache_highres(PhysicButtonsPanel):
|
||||
bl_label = "Smoke High Resolution Cache"
|
||||
bl_default_closed = True
|
||||
bl_label = "Smoke High Resolution Cache"
|
||||
bl_default_closed = True
|
||||
|
||||
def poll(self, context):
|
||||
md = context.smoke
|
||||
return md and (md.smoke_type == 'TYPE_DOMAIN') and md.domain_settings.highres
|
||||
def poll(self, context):
|
||||
md = context.smoke
|
||||
return md and (md.smoke_type == 'TYPE_DOMAIN') and md.domain_settings.highres
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
md = context.smoke.domain_settings
|
||||
cache = md.point_cache_high
|
||||
|
||||
point_cache_ui(self, cache, cache.baked==False, 0, 1)
|
||||
|
||||
md = context.smoke.domain_settings
|
||||
cache = md.point_cache_high
|
||||
|
||||
point_cache_ui(self, cache, cache.baked==False, 0, 1)
|
||||
|
||||
class PHYSICS_PT_smoke_field_weights(PhysicButtonsPanel):
|
||||
bl_label = "Smoke Field Weights"
|
||||
bl_default_closed = True
|
||||
|
||||
def poll(self, context):
|
||||
smoke = context.smoke
|
||||
return (smoke and smoke.smoke_type == 'TYPE_DOMAIN')
|
||||
|
||||
def draw(self, context):
|
||||
domain = context.smoke.domain_settings
|
||||
effector_weights_ui(self, domain.effector_weights)
|
||||
|
||||
bl_label = "Smoke Field Weights"
|
||||
bl_default_closed = True
|
||||
|
||||
def poll(self, context):
|
||||
smoke = context.smoke
|
||||
return (smoke and smoke.smoke_type == 'TYPE_DOMAIN')
|
||||
|
||||
def draw(self, context):
|
||||
domain = context.smoke.domain_settings
|
||||
effector_weights_ui(self, domain.effector_weights)
|
||||
|
||||
bpy.types.register(PHYSICS_PT_smoke)
|
||||
bpy.types.register(PHYSICS_PT_smoke_field_weights)
|
||||
bpy.types.register(PHYSICS_PT_smoke_cache)
|
||||
|
@ -5,236 +5,236 @@ from buttons_physics_common import point_cache_ui
|
||||
from buttons_physics_common import effector_weights_ui
|
||||
|
||||
def softbody_panel_enabled(md):
|
||||
return md.point_cache.baked==False
|
||||
return md.point_cache.baked==False
|
||||
|
||||
class PhysicButtonsPanel(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.object
|
||||
rd = context.scene.render_data
|
||||
return (ob and ob.type == 'MESH') and (not rd.use_game_engine)
|
||||
|
||||
def poll(self, context):
|
||||
ob = context.object
|
||||
rd = context.scene.render_data
|
||||
return (ob and ob.type == 'MESH') and (not rd.use_game_engine)
|
||||
|
||||
class PHYSICS_PT_softbody(PhysicButtonsPanel):
|
||||
bl_label = "Soft Body"
|
||||
bl_label = "Soft Body"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
md = context.soft_body
|
||||
ob = context.object
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
split = layout.split()
|
||||
split.operator_context = "EXEC_DEFAULT"
|
||||
md = context.soft_body
|
||||
ob = context.object
|
||||
|
||||
if md:
|
||||
# remove modifier + settings
|
||||
split.set_context_pointer("modifier", md)
|
||||
split.itemO("object.modifier_remove", text="Remove")
|
||||
split = layout.split()
|
||||
split.operator_context = "EXEC_DEFAULT"
|
||||
|
||||
row = split.row(align=True)
|
||||
row.itemR(md, "render", text="")
|
||||
row.itemR(md, "realtime", text="")
|
||||
else:
|
||||
# add modifier
|
||||
split.item_enumO("object.modifier_add", "type", 'SOFT_BODY', text="Add")
|
||||
split.itemL("")
|
||||
|
||||
if md:
|
||||
softbody = md.settings
|
||||
if md:
|
||||
# remove modifier + settings
|
||||
split.set_context_pointer("modifier", md)
|
||||
split.itemO("object.modifier_remove", text="Remove")
|
||||
|
||||
# General
|
||||
split = layout.split()
|
||||
split.enabled = softbody_panel_enabled(md)
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Object:")
|
||||
col.itemR(softbody, "mass")
|
||||
col.itemR(softbody, "friction")
|
||||
row = split.row(align=True)
|
||||
row.itemR(md, "render", text="")
|
||||
row.itemR(md, "realtime", text="")
|
||||
else:
|
||||
# add modifier
|
||||
split.item_enumO("object.modifier_add", "type", 'SOFT_BODY', text="Add")
|
||||
split.itemL("")
|
||||
|
||||
if md:
|
||||
softbody = md.settings
|
||||
|
||||
# General
|
||||
split = layout.split()
|
||||
split.enabled = softbody_panel_enabled(md)
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Object:")
|
||||
col.itemR(softbody, "mass")
|
||||
col.itemR(softbody, "friction")
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Simulation:")
|
||||
col.itemR(softbody, "speed")
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Simulation:")
|
||||
col.itemR(softbody, "speed")
|
||||
|
||||
class PHYSICS_PT_softbody_cache(PhysicButtonsPanel):
|
||||
bl_label = "Soft Body Cache"
|
||||
bl_default_closed = True
|
||||
bl_label = "Soft Body Cache"
|
||||
bl_default_closed = True
|
||||
|
||||
def poll(self, context):
|
||||
return context.soft_body
|
||||
def poll(self, context):
|
||||
return context.soft_body
|
||||
|
||||
def draw(self, context):
|
||||
md = context.soft_body
|
||||
point_cache_ui(self, md.point_cache, softbody_panel_enabled(md), 0, 0)
|
||||
|
||||
def draw(self, context):
|
||||
md = context.soft_body
|
||||
point_cache_ui(self, md.point_cache, softbody_panel_enabled(md), 0, 0)
|
||||
|
||||
class PHYSICS_PT_softbody_goal(PhysicButtonsPanel):
|
||||
bl_label = "Soft Body Goal"
|
||||
bl_default_closed = True
|
||||
|
||||
def poll(self, context):
|
||||
return context.soft_body
|
||||
|
||||
def draw_header(self, context):
|
||||
softbody = context.soft_body.settings
|
||||
|
||||
self.layout.active = softbody_panel_enabled(context.soft_body)
|
||||
self.layout.itemR(softbody, "use_goal", text="")
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
md = context.soft_body
|
||||
softbody = md.settings
|
||||
ob = context.object
|
||||
|
||||
layout.active = softbody.use_goal and softbody_panel_enabled(md)
|
||||
bl_label = "Soft Body Goal"
|
||||
bl_default_closed = True
|
||||
|
||||
split = layout.split()
|
||||
def poll(self, context):
|
||||
return context.soft_body
|
||||
|
||||
# Goal
|
||||
split = layout.split()
|
||||
def draw_header(self, context):
|
||||
softbody = context.soft_body.settings
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Goal Strengths:")
|
||||
col.itemR(softbody, "goal_default", text="Default")
|
||||
sub = col.column(align=True)
|
||||
sub.itemR(softbody, "goal_min", text="Minimum")
|
||||
sub.itemR(softbody, "goal_max", text="Maximum")
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Goal Settings:")
|
||||
col.itemR(softbody, "goal_spring", text="Stiffness")
|
||||
col.itemR(softbody, "goal_friction", text="Damping")
|
||||
|
||||
layout.item_pointerR(softbody, "goal_vertex_group", ob, "vertex_groups", text="Vertex Group")
|
||||
self.layout.active = softbody_panel_enabled(context.soft_body)
|
||||
self.layout.itemR(softbody, "use_goal", text="")
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
md = context.soft_body
|
||||
softbody = md.settings
|
||||
ob = context.object
|
||||
|
||||
layout.active = softbody.use_goal and softbody_panel_enabled(md)
|
||||
|
||||
split = layout.split()
|
||||
|
||||
# Goal
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Goal Strengths:")
|
||||
col.itemR(softbody, "goal_default", text="Default")
|
||||
sub = col.column(align=True)
|
||||
sub.itemR(softbody, "goal_min", text="Minimum")
|
||||
sub.itemR(softbody, "goal_max", text="Maximum")
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Goal Settings:")
|
||||
col.itemR(softbody, "goal_spring", text="Stiffness")
|
||||
col.itemR(softbody, "goal_friction", text="Damping")
|
||||
|
||||
layout.item_pointerR(softbody, "goal_vertex_group", ob, "vertex_groups", text="Vertex Group")
|
||||
|
||||
class PHYSICS_PT_softbody_edge(PhysicButtonsPanel):
|
||||
bl_label = "Soft Body Edges"
|
||||
bl_default_closed = True
|
||||
|
||||
def poll(self, context):
|
||||
return context.soft_body
|
||||
|
||||
def draw_header(self, context):
|
||||
softbody = context.soft_body.settings
|
||||
|
||||
self.layout.active = softbody_panel_enabled(context.soft_body)
|
||||
self.layout.itemR(softbody, "use_edges", text="")
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
md = context.soft_body
|
||||
softbody = md.settings
|
||||
ob = context.object
|
||||
bl_label = "Soft Body Edges"
|
||||
bl_default_closed = True
|
||||
|
||||
layout.active = softbody.use_edges and softbody_panel_enabled(md)
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Springs:")
|
||||
col.itemR(softbody, "pull")
|
||||
col.itemR(softbody, "push")
|
||||
col.itemR(softbody, "damp")
|
||||
col.itemR(softbody, "plastic")
|
||||
col.itemR(softbody, "bending")
|
||||
col.itemR(softbody, "spring_length", text="Length")
|
||||
|
||||
col = split.column()
|
||||
col.itemR(softbody, "stiff_quads")
|
||||
sub = col.column()
|
||||
sub.active = softbody.stiff_quads
|
||||
sub.itemR(softbody, "shear")
|
||||
|
||||
col.itemR(softbody, "new_aero", text="Aero")
|
||||
sub = col.column()
|
||||
sub.enabled = softbody.new_aero
|
||||
sub.itemR(softbody, "aero", text="Factor")
|
||||
def poll(self, context):
|
||||
return context.soft_body
|
||||
|
||||
def draw_header(self, context):
|
||||
softbody = context.soft_body.settings
|
||||
|
||||
self.layout.active = softbody_panel_enabled(context.soft_body)
|
||||
self.layout.itemR(softbody, "use_edges", text="")
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
md = context.soft_body
|
||||
softbody = md.settings
|
||||
ob = context.object
|
||||
|
||||
layout.active = softbody.use_edges and softbody_panel_enabled(md)
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Springs:")
|
||||
col.itemR(softbody, "pull")
|
||||
col.itemR(softbody, "push")
|
||||
col.itemR(softbody, "damp")
|
||||
col.itemR(softbody, "plastic")
|
||||
col.itemR(softbody, "bending")
|
||||
col.itemR(softbody, "spring_length", text="Length")
|
||||
|
||||
col = split.column()
|
||||
col.itemR(softbody, "stiff_quads")
|
||||
sub = col.column()
|
||||
sub.active = softbody.stiff_quads
|
||||
sub.itemR(softbody, "shear")
|
||||
|
||||
col.itemR(softbody, "new_aero", text="Aero")
|
||||
sub = col.column()
|
||||
sub.enabled = softbody.new_aero
|
||||
sub.itemR(softbody, "aero", text="Factor")
|
||||
|
||||
col.itemL(text="Collision:")
|
||||
col.itemR(softbody, "edge_collision", text="Edge")
|
||||
col.itemR(softbody, "face_collision", text="Face")
|
||||
|
||||
col.itemL(text="Collision:")
|
||||
col.itemR(softbody, "edge_collision", text="Edge")
|
||||
col.itemR(softbody, "face_collision", text="Face")
|
||||
|
||||
class PHYSICS_PT_softbody_collision(PhysicButtonsPanel):
|
||||
bl_label = "Soft Body Collision"
|
||||
bl_default_closed = True
|
||||
|
||||
def poll(self, context):
|
||||
return context.soft_body
|
||||
|
||||
def draw_header(self, context):
|
||||
softbody = context.soft_body.settings
|
||||
|
||||
self.layout.active = softbody_panel_enabled(context.soft_body)
|
||||
self.layout.itemR(softbody, "self_collision", text="")
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
md = context.soft_body
|
||||
softbody = md.settings
|
||||
ob = context.object
|
||||
bl_label = "Soft Body Collision"
|
||||
bl_default_closed = True
|
||||
|
||||
layout.active = softbody.self_collision and softbody_panel_enabled(md)
|
||||
|
||||
layout.itemL(text="Collision Type:")
|
||||
layout.itemR(softbody, "collision_type", expand=True)
|
||||
|
||||
col = layout.column(align=True)
|
||||
col.itemL(text="Ball:")
|
||||
col.itemR(softbody, "ball_size", text="Size")
|
||||
col.itemR(softbody, "ball_stiff", text="Stiffness")
|
||||
col.itemR(softbody, "ball_damp", text="Dampening")
|
||||
def poll(self, context):
|
||||
return context.soft_body
|
||||
|
||||
def draw_header(self, context):
|
||||
softbody = context.soft_body.settings
|
||||
|
||||
self.layout.active = softbody_panel_enabled(context.soft_body)
|
||||
self.layout.itemR(softbody, "self_collision", text="")
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
md = context.soft_body
|
||||
softbody = md.settings
|
||||
ob = context.object
|
||||
|
||||
layout.active = softbody.self_collision and softbody_panel_enabled(md)
|
||||
|
||||
layout.itemL(text="Collision Type:")
|
||||
layout.itemR(softbody, "collision_type", expand=True)
|
||||
|
||||
col = layout.column(align=True)
|
||||
col.itemL(text="Ball:")
|
||||
col.itemR(softbody, "ball_size", text="Size")
|
||||
col.itemR(softbody, "ball_stiff", text="Stiffness")
|
||||
col.itemR(softbody, "ball_damp", text="Dampening")
|
||||
|
||||
class PHYSICS_PT_softbody_solver(PhysicButtonsPanel):
|
||||
bl_label = "Soft Body Solver"
|
||||
bl_default_closed = True
|
||||
|
||||
def poll(self, context):
|
||||
return context.soft_body
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
md = context.soft_body
|
||||
softbody = md.settings
|
||||
ob = context.object
|
||||
bl_label = "Soft Body Solver"
|
||||
bl_default_closed = True
|
||||
|
||||
layout.active = softbody_panel_enabled(md)
|
||||
def poll(self, context):
|
||||
return context.soft_body
|
||||
|
||||
# Solver
|
||||
split = layout.split()
|
||||
|
||||
col = split.column(align=True)
|
||||
col.itemL(text="Step Size:")
|
||||
col.itemR(softbody, "minstep")
|
||||
col.itemR(softbody, "maxstep")
|
||||
col.itemR(softbody, "auto_step", text="Auto-Step")
|
||||
|
||||
col = split.column()
|
||||
col.itemR(softbody, "error_limit")
|
||||
col.itemL(text="Helpers:")
|
||||
col.itemR(softbody, "choke")
|
||||
col.itemR(softbody, "fuzzy")
|
||||
|
||||
layout.itemL(text="Diagnostics:")
|
||||
layout.itemR(softbody, "diagnose")
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
md = context.soft_body
|
||||
softbody = md.settings
|
||||
ob = context.object
|
||||
|
||||
layout.active = softbody_panel_enabled(md)
|
||||
|
||||
# Solver
|
||||
split = layout.split()
|
||||
|
||||
col = split.column(align=True)
|
||||
col.itemL(text="Step Size:")
|
||||
col.itemR(softbody, "minstep")
|
||||
col.itemR(softbody, "maxstep")
|
||||
col.itemR(softbody, "auto_step", text="Auto-Step")
|
||||
|
||||
col = split.column()
|
||||
col.itemR(softbody, "error_limit")
|
||||
col.itemL(text="Helpers:")
|
||||
col.itemR(softbody, "choke")
|
||||
col.itemR(softbody, "fuzzy")
|
||||
|
||||
layout.itemL(text="Diagnostics:")
|
||||
layout.itemR(softbody, "diagnose")
|
||||
|
||||
class PHYSICS_PT_softbody_field_weights(PhysicButtonsPanel):
|
||||
bl_label = "Soft Body Field Weights"
|
||||
bl_default_closed = True
|
||||
|
||||
def poll(self, context):
|
||||
return (context.soft_body)
|
||||
|
||||
def draw(self, context):
|
||||
md = context.soft_body
|
||||
softbody = md.settings
|
||||
effector_weights_ui(self, softbody.effector_weights)
|
||||
|
||||
bl_label = "Soft Body Field Weights"
|
||||
bl_default_closed = True
|
||||
|
||||
def poll(self, context):
|
||||
return (context.soft_body)
|
||||
|
||||
def draw(self, context):
|
||||
md = context.soft_body
|
||||
softbody = md.settings
|
||||
effector_weights_ui(self, softbody.effector_weights)
|
||||
|
||||
bpy.types.register(PHYSICS_PT_softbody)
|
||||
bpy.types.register(PHYSICS_PT_softbody_cache)
|
||||
bpy.types.register(PHYSICS_PT_softbody_goal)
|
||||
|
@ -2,445 +2,445 @@
|
||||
import bpy
|
||||
|
||||
class RenderButtonsPanel(bpy.types.Panel):
|
||||
bl_space_type = 'PROPERTIES'
|
||||
bl_region_type = 'WINDOW'
|
||||
bl_context = "render"
|
||||
# COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here
|
||||
|
||||
def poll(self, context):
|
||||
rd = context.scene.render_data
|
||||
return (context.scene and rd.use_game_engine==False) and (rd.engine in self.COMPAT_ENGINES)
|
||||
bl_space_type = 'PROPERTIES'
|
||||
bl_region_type = 'WINDOW'
|
||||
bl_context = "render"
|
||||
# COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here
|
||||
|
||||
def poll(self, context):
|
||||
rd = context.scene.render_data
|
||||
return (context.scene and rd.use_game_engine==False) and (rd.engine in self.COMPAT_ENGINES)
|
||||
|
||||
class RENDER_PT_render(RenderButtonsPanel):
|
||||
bl_label = "Render"
|
||||
COMPAT_ENGINES = set(['BLENDER_RENDER'])
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
rd = context.scene.render_data
|
||||
bl_label = "Render"
|
||||
COMPAT_ENGINES = set(['BLENDER_RENDER'])
|
||||
|
||||
row = layout.row()
|
||||
row.itemO("screen.render", text="Image", icon='ICON_RENDER_STILL')
|
||||
row.item_booleanO("screen.render", "animation", True, text="Animation", icon='ICON_RENDER_ANIMATION')
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
layout.itemR(rd, "display_mode", text="Display")
|
||||
rd = context.scene.render_data
|
||||
|
||||
row = layout.row()
|
||||
row.itemO("screen.render", text="Image", icon='ICON_RENDER_STILL')
|
||||
row.item_booleanO("screen.render", "animation", True, text="Animation", icon='ICON_RENDER_ANIMATION')
|
||||
|
||||
layout.itemR(rd, "display_mode", text="Display")
|
||||
|
||||
class RENDER_PT_layers(RenderButtonsPanel):
|
||||
bl_label = "Layers"
|
||||
bl_default_closed = True
|
||||
COMPAT_ENGINES = set(['BLENDER_RENDER'])
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
scene = context.scene
|
||||
rd = scene.render_data
|
||||
bl_label = "Layers"
|
||||
bl_default_closed = True
|
||||
COMPAT_ENGINES = set(['BLENDER_RENDER'])
|
||||
|
||||
row = layout.row()
|
||||
row.template_list(rd, "layers", rd, "active_layer_index", rows=2)
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
col = row.column(align=True)
|
||||
col.itemO("scene.render_layer_add", icon='ICON_ZOOMIN', text="")
|
||||
col.itemO("scene.render_layer_remove", icon='ICON_ZOOMOUT', text="")
|
||||
scene = context.scene
|
||||
rd = scene.render_data
|
||||
|
||||
rl = rd.layers[rd.active_layer_index]
|
||||
|
||||
if rl:
|
||||
layout.itemR(rl, "name")
|
||||
row = layout.row()
|
||||
row.template_list(rd, "layers", rd, "active_layer_index", rows=2)
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.itemR(scene, "visible_layers", text="Scene")
|
||||
col = split.column()
|
||||
col.itemR(rl, "visible_layers", text="Layer")
|
||||
col = row.column(align=True)
|
||||
col.itemO("scene.render_layer_add", icon='ICON_ZOOMIN', text="")
|
||||
col.itemO("scene.render_layer_remove", icon='ICON_ZOOMOUT', text="")
|
||||
|
||||
layout.itemR(rl, "light_override", text="Light")
|
||||
layout.itemR(rl, "material_override", text="Material")
|
||||
|
||||
layout.itemS()
|
||||
layout.itemL(text="Include:")
|
||||
|
||||
split = layout.split()
|
||||
rl = rd.layers[rd.active_layer_index]
|
||||
|
||||
col = split.column()
|
||||
col.itemR(rl, "zmask")
|
||||
row = col.row()
|
||||
row.itemR(rl, "zmask_negate", text="Negate")
|
||||
row.active = rl.zmask
|
||||
col.itemR(rl, "all_z")
|
||||
if rl:
|
||||
layout.itemR(rl, "name")
|
||||
|
||||
col = split.column()
|
||||
col.itemR(rl, "solid")
|
||||
col.itemR(rl, "halo")
|
||||
col.itemR(rl, "ztransp")
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.itemR(rl, "sky")
|
||||
col.itemR(rl, "edge")
|
||||
col.itemR(rl, "strand")
|
||||
col = split.column()
|
||||
col.itemR(scene, "visible_layers", text="Scene")
|
||||
col = split.column()
|
||||
col.itemR(rl, "visible_layers", text="Layer")
|
||||
|
||||
if rl.zmask:
|
||||
split = layout.split()
|
||||
split.itemL(text="Zmask Layers:")
|
||||
split.column().itemR(rl, "zmask_layers", text="")
|
||||
|
||||
layout.itemS()
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Passes:")
|
||||
col.itemR(rl, "pass_combined")
|
||||
col.itemR(rl, "pass_z")
|
||||
col.itemR(rl, "pass_vector")
|
||||
col.itemR(rl, "pass_normal")
|
||||
col.itemR(rl, "pass_uv")
|
||||
col.itemR(rl, "pass_mist")
|
||||
col.itemR(rl, "pass_object_index")
|
||||
layout.itemR(rl, "light_override", text="Light")
|
||||
layout.itemR(rl, "material_override", text="Material")
|
||||
|
||||
col = split.column()
|
||||
col.itemL()
|
||||
col.itemR(rl, "pass_color")
|
||||
col.itemR(rl, "pass_diffuse")
|
||||
row = col.row()
|
||||
row.itemR(rl, "pass_specular")
|
||||
row.itemR(rl, "pass_specular_exclude", text="", icon='ICON_X')
|
||||
row = col.row()
|
||||
row.itemR(rl, "pass_shadow")
|
||||
row.itemR(rl, "pass_shadow_exclude", text="", icon='ICON_X')
|
||||
row = col.row()
|
||||
row.itemR(rl, "pass_ao")
|
||||
row.itemR(rl, "pass_ao_exclude", text="", icon='ICON_X')
|
||||
row = col.row()
|
||||
row.itemR(rl, "pass_reflection")
|
||||
row.itemR(rl, "pass_reflection_exclude", text="", icon='ICON_X')
|
||||
row = col.row()
|
||||
row.itemR(rl, "pass_refraction")
|
||||
row.itemR(rl, "pass_refraction_exclude", text="", icon='ICON_X')
|
||||
layout.itemS()
|
||||
layout.itemL(text="Include:")
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.itemR(rl, "zmask")
|
||||
row = col.row()
|
||||
row.itemR(rl, "zmask_negate", text="Negate")
|
||||
row.active = rl.zmask
|
||||
col.itemR(rl, "all_z")
|
||||
|
||||
col = split.column()
|
||||
col.itemR(rl, "solid")
|
||||
col.itemR(rl, "halo")
|
||||
col.itemR(rl, "ztransp")
|
||||
|
||||
col = split.column()
|
||||
col.itemR(rl, "sky")
|
||||
col.itemR(rl, "edge")
|
||||
col.itemR(rl, "strand")
|
||||
|
||||
if rl.zmask:
|
||||
split = layout.split()
|
||||
split.itemL(text="Zmask Layers:")
|
||||
split.column().itemR(rl, "zmask_layers", text="")
|
||||
|
||||
layout.itemS()
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Passes:")
|
||||
col.itemR(rl, "pass_combined")
|
||||
col.itemR(rl, "pass_z")
|
||||
col.itemR(rl, "pass_vector")
|
||||
col.itemR(rl, "pass_normal")
|
||||
col.itemR(rl, "pass_uv")
|
||||
col.itemR(rl, "pass_mist")
|
||||
col.itemR(rl, "pass_object_index")
|
||||
|
||||
col = split.column()
|
||||
col.itemL()
|
||||
col.itemR(rl, "pass_color")
|
||||
col.itemR(rl, "pass_diffuse")
|
||||
row = col.row()
|
||||
row.itemR(rl, "pass_specular")
|
||||
row.itemR(rl, "pass_specular_exclude", text="", icon='ICON_X')
|
||||
row = col.row()
|
||||
row.itemR(rl, "pass_shadow")
|
||||
row.itemR(rl, "pass_shadow_exclude", text="", icon='ICON_X')
|
||||
row = col.row()
|
||||
row.itemR(rl, "pass_ao")
|
||||
row.itemR(rl, "pass_ao_exclude", text="", icon='ICON_X')
|
||||
row = col.row()
|
||||
row.itemR(rl, "pass_reflection")
|
||||
row.itemR(rl, "pass_reflection_exclude", text="", icon='ICON_X')
|
||||
row = col.row()
|
||||
row.itemR(rl, "pass_refraction")
|
||||
row.itemR(rl, "pass_refraction_exclude", text="", icon='ICON_X')
|
||||
|
||||
class RENDER_PT_shading(RenderButtonsPanel):
|
||||
bl_label = "Shading"
|
||||
COMPAT_ENGINES = set(['BLENDER_RENDER'])
|
||||
bl_label = "Shading"
|
||||
COMPAT_ENGINES = set(['BLENDER_RENDER'])
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
rd = context.scene.render_data
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.itemR(rd, "render_textures", text="Textures")
|
||||
col.itemR(rd, "render_shadows", text="Shadows")
|
||||
col.itemR(rd, "render_sss", text="Subsurface Scattering")
|
||||
col.itemR(rd, "render_envmaps", text="Environment Map")
|
||||
|
||||
col = split.column()
|
||||
col.itemR(rd, "render_raytracing", text="Ray Tracing")
|
||||
col.itemR(rd, "color_management")
|
||||
col.itemR(rd, "alpha_mode", text="Alpha")
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
rd = context.scene.render_data
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.itemR(rd, "render_textures", text="Textures")
|
||||
col.itemR(rd, "render_shadows", text="Shadows")
|
||||
col.itemR(rd, "render_sss", text="Subsurface Scattering")
|
||||
col.itemR(rd, "render_envmaps", text="Environment Map")
|
||||
|
||||
col = split.column()
|
||||
col.itemR(rd, "render_raytracing", text="Ray Tracing")
|
||||
col.itemR(rd, "color_management")
|
||||
col.itemR(rd, "alpha_mode", text="Alpha")
|
||||
|
||||
class RENDER_PT_performance(RenderButtonsPanel):
|
||||
bl_label = "Performance"
|
||||
bl_default_closed = True
|
||||
COMPAT_ENGINES = set(['BLENDER_RENDER'])
|
||||
bl_label = "Performance"
|
||||
bl_default_closed = True
|
||||
COMPAT_ENGINES = set(['BLENDER_RENDER'])
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
rd = context.scene.render_data
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column(align=True)
|
||||
col.itemL(text="Threads:")
|
||||
col.row().itemR(rd, "threads_mode", expand=True)
|
||||
sub = col.column()
|
||||
sub.enabled = rd.threads_mode == 'THREADS_FIXED'
|
||||
sub.itemR(rd, "threads")
|
||||
col.itemL(text="Tiles:")
|
||||
col.itemR(rd, "parts_x", text="X")
|
||||
col.itemR(rd, "parts_y", text="Y")
|
||||
rd = context.scene.render_data
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Memory:")
|
||||
sub = col.column()
|
||||
sub.itemR(rd, "save_buffers")
|
||||
sub.enabled = not rd.full_sample
|
||||
sub = col.column()
|
||||
sub.active = rd.use_compositing
|
||||
sub.itemR(rd, "free_image_textures")
|
||||
sub = col.column()
|
||||
sub.active = rd.render_raytracing
|
||||
sub.itemL(text="Acceleration structure:")
|
||||
sub.itemR(rd, "raytrace_structure", text="")
|
||||
if rd.raytrace_structure == "OCTREE":
|
||||
sub.itemR(rd, "octree_resolution", text="Resolution")
|
||||
else:
|
||||
sub.itemR(rd, "use_instances", text="Instances")
|
||||
sub.itemR(rd, "use_local_coords", text="Local Coordinates")
|
||||
split = layout.split()
|
||||
|
||||
col = split.column(align=True)
|
||||
col.itemL(text="Threads:")
|
||||
col.row().itemR(rd, "threads_mode", expand=True)
|
||||
sub = col.column()
|
||||
sub.enabled = rd.threads_mode == 'THREADS_FIXED'
|
||||
sub.itemR(rd, "threads")
|
||||
col.itemL(text="Tiles:")
|
||||
col.itemR(rd, "parts_x", text="X")
|
||||
col.itemR(rd, "parts_y", text="Y")
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Memory:")
|
||||
sub = col.column()
|
||||
sub.itemR(rd, "save_buffers")
|
||||
sub.enabled = not rd.full_sample
|
||||
sub = col.column()
|
||||
sub.active = rd.use_compositing
|
||||
sub.itemR(rd, "free_image_textures")
|
||||
sub = col.column()
|
||||
sub.active = rd.render_raytracing
|
||||
sub.itemL(text="Acceleration structure:")
|
||||
sub.itemR(rd, "raytrace_structure", text="")
|
||||
if rd.raytrace_structure == "OCTREE":
|
||||
sub.itemR(rd, "octree_resolution", text="Resolution")
|
||||
else:
|
||||
sub.itemR(rd, "use_instances", text="Instances")
|
||||
sub.itemR(rd, "use_local_coords", text="Local Coordinates")
|
||||
|
||||
class RENDER_PT_post_processing(RenderButtonsPanel):
|
||||
bl_label = "Post Processing"
|
||||
bl_default_closed = True
|
||||
COMPAT_ENGINES = set(['BLENDER_RENDER'])
|
||||
bl_label = "Post Processing"
|
||||
bl_default_closed = True
|
||||
COMPAT_ENGINES = set(['BLENDER_RENDER'])
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
rd = context.scene.render_data
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
split = layout.split()
|
||||
rd = context.scene.render_data
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.itemR(rd, "use_compositing")
|
||||
col.itemR(rd, "use_sequencer")
|
||||
|
||||
col = split.column()
|
||||
col.itemR(rd, "dither_intensity", text="Dither", slider=True)
|
||||
|
||||
layout.itemS()
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.itemR(rd, "fields", text="Fields")
|
||||
sub = col.column()
|
||||
sub.active = rd.fields
|
||||
sub.row().itemR(rd, "field_order", expand=True)
|
||||
sub.itemR(rd, "fields_still", text="Still")
|
||||
|
||||
col = split.column()
|
||||
col.itemR(rd, "edge")
|
||||
sub = col.column()
|
||||
sub.active = rd.edge
|
||||
sub.itemR(rd, "edge_threshold", text="Threshold", slider=True)
|
||||
sub.itemR(rd, "edge_color", text="")
|
||||
|
||||
col = split.column()
|
||||
col.itemR(rd, "use_compositing")
|
||||
col.itemR(rd, "use_sequencer")
|
||||
|
||||
col = split.column()
|
||||
col.itemR(rd, "dither_intensity", text="Dither", slider=True)
|
||||
|
||||
layout.itemS()
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.itemR(rd, "fields", text="Fields")
|
||||
sub = col.column()
|
||||
sub.active = rd.fields
|
||||
sub.row().itemR(rd, "field_order", expand=True)
|
||||
sub.itemR(rd, "fields_still", text="Still")
|
||||
|
||||
col = split.column()
|
||||
col.itemR(rd, "edge")
|
||||
sub = col.column()
|
||||
sub.active = rd.edge
|
||||
sub.itemR(rd, "edge_threshold", text="Threshold", slider=True)
|
||||
sub.itemR(rd, "edge_color", text="")
|
||||
|
||||
class RENDER_PT_output(RenderButtonsPanel):
|
||||
bl_label = "Output"
|
||||
COMPAT_ENGINES = set(['BLENDER_RENDER'])
|
||||
bl_label = "Output"
|
||||
COMPAT_ENGINES = set(['BLENDER_RENDER'])
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
rd = context.scene.render_data
|
||||
|
||||
layout.itemR(rd, "output_path", text="")
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
split = layout.split()
|
||||
col = split.column()
|
||||
col.itemR(rd, "file_format", text="")
|
||||
col.row().itemR(rd, "color_mode", text="Color", expand=True)
|
||||
rd = context.scene.render_data
|
||||
|
||||
col = split.column()
|
||||
col.itemR(rd, "file_extensions")
|
||||
col.itemR(rd, "use_overwrite")
|
||||
col.itemR(rd, "use_placeholder")
|
||||
layout.itemR(rd, "output_path", text="")
|
||||
|
||||
if rd.file_format in ('AVIJPEG', 'JPEG'):
|
||||
split = layout.split()
|
||||
split.itemR(rd, "quality", slider=True)
|
||||
|
||||
elif rd.file_format == 'OPENEXR':
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Codec:")
|
||||
col.itemR(rd, "exr_codec", text="")
|
||||
split = layout.split()
|
||||
col = split.column()
|
||||
col.itemR(rd, "file_format", text="")
|
||||
col.row().itemR(rd, "color_mode", text="Color", expand=True)
|
||||
|
||||
subsplit = split.split()
|
||||
col = subsplit.column()
|
||||
col.itemR(rd, "exr_half")
|
||||
col.itemR(rd, "exr_zbuf")
|
||||
col = subsplit.column()
|
||||
col.itemR(rd, "exr_preview")
|
||||
|
||||
elif rd.file_format == 'JPEG2000':
|
||||
split = layout.split()
|
||||
col = split.column()
|
||||
col.itemL(text="Depth:")
|
||||
col.row().itemR(rd, "jpeg2k_depth", expand=True)
|
||||
col = split.column()
|
||||
col.itemR(rd, "file_extensions")
|
||||
col.itemR(rd, "use_overwrite")
|
||||
col.itemR(rd, "use_placeholder")
|
||||
|
||||
col = split.column()
|
||||
col.itemR(rd, "jpeg2k_preset", text="")
|
||||
col.itemR(rd, "jpeg2k_ycc")
|
||||
|
||||
elif rd.file_format in ('CINEON', 'DPX'):
|
||||
split = layout.split()
|
||||
col = split.column()
|
||||
col.itemR(rd, "cineon_log", text="Convert to Log")
|
||||
if rd.file_format in ('AVIJPEG', 'JPEG'):
|
||||
split = layout.split()
|
||||
split.itemR(rd, "quality", slider=True)
|
||||
|
||||
col = split.column(align=True)
|
||||
col.active = rd.cineon_log
|
||||
col.itemR(rd, "cineon_black", text="Black")
|
||||
col.itemR(rd, "cineon_white", text="White")
|
||||
col.itemR(rd, "cineon_gamma", text="Gamma")
|
||||
|
||||
elif rd.file_format == 'TIFF':
|
||||
split = layout.split()
|
||||
split.itemR(rd, "tiff_bit")
|
||||
elif rd.file_format == 'OPENEXR':
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Codec:")
|
||||
col.itemR(rd, "exr_codec", text="")
|
||||
|
||||
subsplit = split.split()
|
||||
col = subsplit.column()
|
||||
col.itemR(rd, "exr_half")
|
||||
col.itemR(rd, "exr_zbuf")
|
||||
col = subsplit.column()
|
||||
col.itemR(rd, "exr_preview")
|
||||
|
||||
elif rd.file_format == 'JPEG2000':
|
||||
split = layout.split()
|
||||
col = split.column()
|
||||
col.itemL(text="Depth:")
|
||||
col.row().itemR(rd, "jpeg2k_depth", expand=True)
|
||||
|
||||
col = split.column()
|
||||
col.itemR(rd, "jpeg2k_preset", text="")
|
||||
col.itemR(rd, "jpeg2k_ycc")
|
||||
|
||||
elif rd.file_format in ('CINEON', 'DPX'):
|
||||
split = layout.split()
|
||||
col = split.column()
|
||||
col.itemR(rd, "cineon_log", text="Convert to Log")
|
||||
|
||||
col = split.column(align=True)
|
||||
col.active = rd.cineon_log
|
||||
col.itemR(rd, "cineon_black", text="Black")
|
||||
col.itemR(rd, "cineon_white", text="White")
|
||||
col.itemR(rd, "cineon_gamma", text="Gamma")
|
||||
|
||||
elif rd.file_format == 'TIFF':
|
||||
split = layout.split()
|
||||
split.itemR(rd, "tiff_bit")
|
||||
|
||||
class RENDER_PT_encoding(RenderButtonsPanel):
|
||||
bl_label = "Encoding"
|
||||
bl_default_closed = True
|
||||
COMPAT_ENGINES = set(['BLENDER_RENDER'])
|
||||
|
||||
def poll(self, context):
|
||||
rd = context.scene.render_data
|
||||
return rd.file_format in ('FFMPEG', 'XVID', 'H264', 'THEORA')
|
||||
bl_label = "Encoding"
|
||||
bl_default_closed = True
|
||||
COMPAT_ENGINES = set(['BLENDER_RENDER'])
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
rd = context.scene.render_data
|
||||
def poll(self, context):
|
||||
rd = context.scene.render_data
|
||||
return rd.file_format in ('FFMPEG', 'XVID', 'H264', 'THEORA')
|
||||
|
||||
split = layout.split()
|
||||
|
||||
split.itemR(rd, "ffmpeg_format")
|
||||
if rd.ffmpeg_format in ('AVI', 'QUICKTIME', 'MKV', 'OGG'):
|
||||
split.itemR(rd, "ffmpeg_codec")
|
||||
else:
|
||||
split.itemL()
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.itemR(rd, "ffmpeg_video_bitrate")
|
||||
col.itemL(text="Rate:")
|
||||
col.itemR(rd, "ffmpeg_minrate", text="Minimum")
|
||||
col.itemR(rd, "ffmpeg_maxrate", text="Maximum")
|
||||
col.itemR(rd, "ffmpeg_buffersize", text="Buffer")
|
||||
|
||||
col = split.column()
|
||||
col.itemR(rd, "ffmpeg_gopsize")
|
||||
col.itemR(rd, "ffmpeg_autosplit")
|
||||
col.itemL(text="Mux:")
|
||||
col.itemR(rd, "ffmpeg_muxrate", text="Rate")
|
||||
col.itemR(rd, "ffmpeg_packetsize", text="Packet Size")
|
||||
|
||||
row = layout.row()
|
||||
row.itemL(text="Audio:")
|
||||
row = layout.row()
|
||||
row.itemR(rd, "ffmpeg_audio_codec")
|
||||
|
||||
split = layout.split()
|
||||
rd = context.scene.render_data
|
||||
|
||||
col = split.column()
|
||||
col.itemR(rd, "ffmpeg_audio_bitrate")
|
||||
col.itemR(rd, "ffmpeg_audio_mixrate")
|
||||
col = split.column()
|
||||
col.itemR(rd, "ffmpeg_multiplex_audio")
|
||||
col.itemR(rd, "ffmpeg_audio_volume")
|
||||
split = layout.split()
|
||||
|
||||
split.itemR(rd, "ffmpeg_format")
|
||||
if rd.ffmpeg_format in ('AVI', 'QUICKTIME', 'MKV', 'OGG'):
|
||||
split.itemR(rd, "ffmpeg_codec")
|
||||
else:
|
||||
split.itemL()
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.itemR(rd, "ffmpeg_video_bitrate")
|
||||
col.itemL(text="Rate:")
|
||||
col.itemR(rd, "ffmpeg_minrate", text="Minimum")
|
||||
col.itemR(rd, "ffmpeg_maxrate", text="Maximum")
|
||||
col.itemR(rd, "ffmpeg_buffersize", text="Buffer")
|
||||
|
||||
col = split.column()
|
||||
col.itemR(rd, "ffmpeg_gopsize")
|
||||
col.itemR(rd, "ffmpeg_autosplit")
|
||||
col.itemL(text="Mux:")
|
||||
col.itemR(rd, "ffmpeg_muxrate", text="Rate")
|
||||
col.itemR(rd, "ffmpeg_packetsize", text="Packet Size")
|
||||
|
||||
row = layout.row()
|
||||
row.itemL(text="Audio:")
|
||||
row = layout.row()
|
||||
row.itemR(rd, "ffmpeg_audio_codec")
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.itemR(rd, "ffmpeg_audio_bitrate")
|
||||
col.itemR(rd, "ffmpeg_audio_mixrate")
|
||||
col = split.column()
|
||||
col.itemR(rd, "ffmpeg_multiplex_audio")
|
||||
col.itemR(rd, "ffmpeg_audio_volume")
|
||||
|
||||
class RENDER_PT_antialiasing(RenderButtonsPanel):
|
||||
bl_label = "Anti-Aliasing"
|
||||
COMPAT_ENGINES = set(['BLENDER_RENDER'])
|
||||
bl_label = "Anti-Aliasing"
|
||||
COMPAT_ENGINES = set(['BLENDER_RENDER'])
|
||||
|
||||
def draw_header(self, context):
|
||||
rd = context.scene.render_data
|
||||
def draw_header(self, context):
|
||||
rd = context.scene.render_data
|
||||
|
||||
self.layout.itemR(rd, "antialiasing", text="")
|
||||
self.layout.itemR(rd, "antialiasing", text="")
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
rd = context.scene.render_data
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
layout.active = rd.antialiasing
|
||||
rd = context.scene.render_data
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.row().itemR(rd, "antialiasing_samples", expand=True)
|
||||
col.itemR(rd, "full_sample")
|
||||
layout.active = rd.antialiasing
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.row().itemR(rd, "antialiasing_samples", expand=True)
|
||||
col.itemR(rd, "full_sample")
|
||||
|
||||
col = split.column()
|
||||
col.itemR(rd, "pixel_filter", text="")
|
||||
col.itemR(rd, "filter_size", text="Size", slider=True)
|
||||
|
||||
col = split.column()
|
||||
col.itemR(rd, "pixel_filter", text="")
|
||||
col.itemR(rd, "filter_size", text="Size", slider=True)
|
||||
|
||||
class RENDER_PT_dimensions(RenderButtonsPanel):
|
||||
bl_label = "Dimensions"
|
||||
COMPAT_ENGINES = set(['BLENDER_RENDER'])
|
||||
bl_label = "Dimensions"
|
||||
COMPAT_ENGINES = set(['BLENDER_RENDER'])
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
scene = context.scene
|
||||
rd = scene.render_data
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
sub = col.column(align=True)
|
||||
sub.itemL(text="Resolution:")
|
||||
sub.itemR(rd, "resolution_x", text="X")
|
||||
sub.itemR(rd, "resolution_y", text="Y")
|
||||
sub.itemR(rd, "resolution_percentage", text="")
|
||||
|
||||
sub.itemL(text="Aspect Ratio:")
|
||||
sub.itemR(rd, "pixel_aspect_x", text="X")
|
||||
sub.itemR(rd, "pixel_aspect_y", text="Y")
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
row = col.row()
|
||||
row.itemR(rd, "use_border", text="Border")
|
||||
rowsub = row.row()
|
||||
rowsub.active = rd.use_border
|
||||
rowsub.itemR(rd, "crop_to_border", text="Crop")
|
||||
|
||||
col = split.column(align=True)
|
||||
col.itemL(text="Frame Range:")
|
||||
col.itemR(scene, "start_frame", text="Start")
|
||||
col.itemR(scene, "end_frame", text="End")
|
||||
col.itemR(scene, "frame_step", text="Step")
|
||||
|
||||
col.itemL(text="Frame Rate:")
|
||||
col.itemR(rd, "fps")
|
||||
col.itemR(rd, "fps_base",text="/")
|
||||
scene = context.scene
|
||||
rd = scene.render_data
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
sub = col.column(align=True)
|
||||
sub.itemL(text="Resolution:")
|
||||
sub.itemR(rd, "resolution_x", text="X")
|
||||
sub.itemR(rd, "resolution_y", text="Y")
|
||||
sub.itemR(rd, "resolution_percentage", text="")
|
||||
|
||||
sub.itemL(text="Aspect Ratio:")
|
||||
sub.itemR(rd, "pixel_aspect_x", text="X")
|
||||
sub.itemR(rd, "pixel_aspect_y", text="Y")
|
||||
|
||||
row = col.row()
|
||||
row.itemR(rd, "use_border", text="Border")
|
||||
rowsub = row.row()
|
||||
rowsub.active = rd.use_border
|
||||
rowsub.itemR(rd, "crop_to_border", text="Crop")
|
||||
|
||||
col = split.column(align=True)
|
||||
col.itemL(text="Frame Range:")
|
||||
col.itemR(scene, "start_frame", text="Start")
|
||||
col.itemR(scene, "end_frame", text="End")
|
||||
col.itemR(scene, "frame_step", text="Step")
|
||||
|
||||
col.itemL(text="Frame Rate:")
|
||||
col.itemR(rd, "fps")
|
||||
col.itemR(rd, "fps_base",text="/")
|
||||
|
||||
class RENDER_PT_stamp(RenderButtonsPanel):
|
||||
bl_label = "Stamp"
|
||||
bl_default_closed = True
|
||||
COMPAT_ENGINES = set(['BLENDER_RENDER'])
|
||||
bl_label = "Stamp"
|
||||
bl_default_closed = True
|
||||
COMPAT_ENGINES = set(['BLENDER_RENDER'])
|
||||
|
||||
def draw_header(self, context):
|
||||
rd = context.scene.render_data
|
||||
def draw_header(self, context):
|
||||
rd = context.scene.render_data
|
||||
|
||||
self.layout.itemR(rd, "render_stamp", text="")
|
||||
self.layout.itemR(rd, "render_stamp", text="")
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
rd = context.scene.render_data
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
layout.active = rd.render_stamp
|
||||
rd = context.scene.render_data
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.itemR(rd, "stamp_time", text="Time")
|
||||
col.itemR(rd, "stamp_date", text="Date")
|
||||
col.itemR(rd, "stamp_render_time", text="RenderTime")
|
||||
col.itemR(rd, "stamp_frame", text="Frame")
|
||||
col.itemR(rd, "stamp_scene", text="Scene")
|
||||
col.itemR(rd, "stamp_camera", text="Camera")
|
||||
col.itemR(rd, "stamp_filename", text="Filename")
|
||||
col.itemR(rd, "stamp_marker", text="Marker")
|
||||
col.itemR(rd, "stamp_sequence_strip", text="Seq. Strip")
|
||||
layout.active = rd.render_stamp
|
||||
|
||||
col = split.column()
|
||||
col.active = rd.render_stamp
|
||||
col.itemR(rd, "stamp_foreground", slider=True)
|
||||
col.itemR(rd, "stamp_background", slider=True)
|
||||
col.itemR(rd, "stamp_font_size", text="Font Size")
|
||||
split = layout.split()
|
||||
|
||||
row = layout.split(percentage=0.2)
|
||||
row.itemR(rd, "stamp_note", text="Note")
|
||||
sub = row.row()
|
||||
sub.active = rd.stamp_note
|
||||
sub.itemR(rd, "stamp_note_text", text="")
|
||||
col = split.column()
|
||||
col.itemR(rd, "stamp_time", text="Time")
|
||||
col.itemR(rd, "stamp_date", text="Date")
|
||||
col.itemR(rd, "stamp_render_time", text="RenderTime")
|
||||
col.itemR(rd, "stamp_frame", text="Frame")
|
||||
col.itemR(rd, "stamp_scene", text="Scene")
|
||||
col.itemR(rd, "stamp_camera", text="Camera")
|
||||
col.itemR(rd, "stamp_filename", text="Filename")
|
||||
col.itemR(rd, "stamp_marker", text="Marker")
|
||||
col.itemR(rd, "stamp_sequence_strip", text="Seq. Strip")
|
||||
|
||||
col = split.column()
|
||||
col.active = rd.render_stamp
|
||||
col.itemR(rd, "stamp_foreground", slider=True)
|
||||
col.itemR(rd, "stamp_background", slider=True)
|
||||
col.itemR(rd, "stamp_font_size", text="Font Size")
|
||||
|
||||
row = layout.split(percentage=0.2)
|
||||
row.itemR(rd, "stamp_note", text="Note")
|
||||
sub = row.row()
|
||||
sub.active = rd.stamp_note
|
||||
sub.itemR(rd, "stamp_note_text", text="")
|
||||
|
||||
bpy.types.register(RENDER_PT_render)
|
||||
bpy.types.register(RENDER_PT_layers)
|
||||
|
@ -2,135 +2,135 @@
|
||||
import bpy
|
||||
|
||||
class SceneButtonsPanel(bpy.types.Panel):
|
||||
bl_space_type = 'PROPERTIES'
|
||||
bl_region_type = 'WINDOW'
|
||||
bl_context = "scene"
|
||||
|
||||
def poll(self, context):
|
||||
return context.scene
|
||||
bl_space_type = 'PROPERTIES'
|
||||
bl_region_type = 'WINDOW'
|
||||
bl_context = "scene"
|
||||
|
||||
def poll(self, context):
|
||||
return context.scene
|
||||
|
||||
class SCENE_PT_scene(SceneButtonsPanel):
|
||||
bl_label = "Scene"
|
||||
COMPAT_ENGINES = set(['BLENDER_RENDER'])
|
||||
bl_label = "Scene"
|
||||
COMPAT_ENGINES = set(['BLENDER_RENDER'])
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
scene = context.scene
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
layout.itemR(scene, "camera")
|
||||
layout.itemR(scene, "set", text="Background")
|
||||
scene = context.scene
|
||||
|
||||
layout.itemR(scene, "camera")
|
||||
layout.itemR(scene, "set", text="Background")
|
||||
|
||||
class SCENE_PT_unit(SceneButtonsPanel):
|
||||
bl_label = "Units"
|
||||
COMPAT_ENGINES = set(['BLENDER_RENDER'])
|
||||
bl_label = "Units"
|
||||
COMPAT_ENGINES = set(['BLENDER_RENDER'])
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
unit = context.scene.unit_settings
|
||||
|
||||
col = layout.column()
|
||||
col.row().itemR(unit, "system", expand=True)
|
||||
|
||||
row = layout.row()
|
||||
row.active = (unit.system != 'NONE')
|
||||
row.itemR(unit, "scale_length", text="Scale")
|
||||
row.itemR(unit, "use_separate")
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
unit = context.scene.unit_settings
|
||||
|
||||
col = layout.column()
|
||||
col.row().itemR(unit, "system", expand=True)
|
||||
|
||||
row = layout.row()
|
||||
row.active = (unit.system != 'NONE')
|
||||
row.itemR(unit, "scale_length", text="Scale")
|
||||
row.itemR(unit, "use_separate")
|
||||
|
||||
class SCENE_PT_keying_sets(SceneButtonsPanel):
|
||||
bl_label = "Keying Sets"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
scene = context.scene
|
||||
|
||||
row = layout.row()
|
||||
|
||||
col = row.column()
|
||||
col.template_list(scene, "keying_sets", scene, "active_keying_set_index", rows=2)
|
||||
|
||||
col = row.column(align=True)
|
||||
col.itemO("anim.keying_set_add", icon='ICON_ZOOMIN', text="")
|
||||
col.itemO("anim.keying_set_remove", icon='ICON_ZOOMOUT', text="")
|
||||
|
||||
ks = scene.active_keying_set
|
||||
if ks:
|
||||
row = layout.row()
|
||||
|
||||
col = row.column()
|
||||
col.itemR(ks, "name")
|
||||
col.itemR(ks, "absolute")
|
||||
|
||||
col = row.column()
|
||||
col.itemL(text="Keyframing Settings:")
|
||||
col.itemR(ks, "insertkey_needed", text="Needed")
|
||||
col.itemR(ks, "insertkey_visual", text="Visual")
|
||||
|
||||
bl_label = "Keying Sets"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
scene = context.scene
|
||||
|
||||
row = layout.row()
|
||||
|
||||
col = row.column()
|
||||
col.template_list(scene, "keying_sets", scene, "active_keying_set_index", rows=2)
|
||||
|
||||
col = row.column(align=True)
|
||||
col.itemO("anim.keying_set_add", icon='ICON_ZOOMIN', text="")
|
||||
col.itemO("anim.keying_set_remove", icon='ICON_ZOOMOUT', text="")
|
||||
|
||||
ks = scene.active_keying_set
|
||||
if ks:
|
||||
row = layout.row()
|
||||
|
||||
col = row.column()
|
||||
col.itemR(ks, "name")
|
||||
col.itemR(ks, "absolute")
|
||||
|
||||
col = row.column()
|
||||
col.itemL(text="Keyframing Settings:")
|
||||
col.itemR(ks, "insertkey_needed", text="Needed")
|
||||
col.itemR(ks, "insertkey_visual", text="Visual")
|
||||
|
||||
class SCENE_PT_keying_set_paths(SceneButtonsPanel):
|
||||
bl_label = "Active Keying Set"
|
||||
|
||||
def poll(self, context):
|
||||
return (context.scene != None) and (context.scene.active_keying_set != None)
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
scene = context.scene
|
||||
ks = scene.active_keying_set
|
||||
|
||||
row = layout.row()
|
||||
row.itemL(text="Paths:")
|
||||
|
||||
row = layout.row()
|
||||
|
||||
col = row.column()
|
||||
col.template_list(ks, "paths", ks, "active_path_index", rows=2)
|
||||
|
||||
col = row.column(align=True)
|
||||
col.itemO("anim.keying_set_path_add", icon='ICON_ZOOMIN', text="")
|
||||
col.itemO("anim.keying_set_path_remove", icon='ICON_ZOOMOUT', text="")
|
||||
|
||||
ksp = ks.active_path
|
||||
if ksp:
|
||||
col = layout.column()
|
||||
col.itemL(text="Target:")
|
||||
col.template_any_ID(ksp, "id", "id_type")
|
||||
col.template_path_builder(ksp, "rna_path", ksp.id)
|
||||
|
||||
|
||||
row = layout.row()
|
||||
|
||||
col = row.column()
|
||||
col.itemL(text="Array Target:")
|
||||
col.itemR(ksp, "entire_array")
|
||||
if ksp.entire_array == False:
|
||||
col.itemR(ksp, "array_index")
|
||||
|
||||
col = row.column()
|
||||
col.itemL(text="F-Curve Grouping:")
|
||||
col.itemR(ksp, "grouping")
|
||||
if ksp.grouping == 'NAMED':
|
||||
col.itemR(ksp, "group")
|
||||
bl_label = "Active Keying Set"
|
||||
|
||||
def poll(self, context):
|
||||
return (context.scene != None) and (context.scene.active_keying_set != None)
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
scene = context.scene
|
||||
ks = scene.active_keying_set
|
||||
|
||||
row = layout.row()
|
||||
row.itemL(text="Paths:")
|
||||
|
||||
row = layout.row()
|
||||
|
||||
col = row.column()
|
||||
col.template_list(ks, "paths", ks, "active_path_index", rows=2)
|
||||
|
||||
col = row.column(align=True)
|
||||
col.itemO("anim.keying_set_path_add", icon='ICON_ZOOMIN', text="")
|
||||
col.itemO("anim.keying_set_path_remove", icon='ICON_ZOOMOUT', text="")
|
||||
|
||||
ksp = ks.active_path
|
||||
if ksp:
|
||||
col = layout.column()
|
||||
col.itemL(text="Target:")
|
||||
col.template_any_ID(ksp, "id", "id_type")
|
||||
col.template_path_builder(ksp, "rna_path", ksp.id)
|
||||
|
||||
|
||||
row = layout.row()
|
||||
|
||||
col = row.column()
|
||||
col.itemL(text="Array Target:")
|
||||
col.itemR(ksp, "entire_array")
|
||||
if ksp.entire_array == False:
|
||||
col.itemR(ksp, "array_index")
|
||||
|
||||
col = row.column()
|
||||
col.itemL(text="F-Curve Grouping:")
|
||||
col.itemR(ksp, "grouping")
|
||||
if ksp.grouping == 'NAMED':
|
||||
col.itemR(ksp, "group")
|
||||
|
||||
class SCENE_PT_physics(SceneButtonsPanel):
|
||||
bl_label = "Gravity"
|
||||
COMPAT_ENGINES = set(['BLENDER_RENDER'])
|
||||
bl_label = "Gravity"
|
||||
COMPAT_ENGINES = set(['BLENDER_RENDER'])
|
||||
|
||||
def draw_header(self, context):
|
||||
self.layout.itemR(context.scene, "use_gravity", text="")
|
||||
def draw_header(self, context):
|
||||
self.layout.itemR(context.scene, "use_gravity", text="")
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
scene = context.scene
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
layout.active = scene.use_gravity
|
||||
scene = context.scene
|
||||
|
||||
layout.itemR(scene, "gravity", text="")
|
||||
layout.active = scene.use_gravity
|
||||
|
||||
bpy.types.register(SCENE_PT_scene)
|
||||
layout.itemR(scene, "gravity", text="")
|
||||
|
||||
bpy.types.register(SCENE_PT_scene)
|
||||
bpy.types.register(SCENE_PT_unit)
|
||||
bpy.types.register(SCENE_PT_keying_sets)
|
||||
bpy.types.register(SCENE_PT_keying_set_paths)
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -2,181 +2,181 @@
|
||||
import bpy
|
||||
|
||||
class WorldButtonsPanel(bpy.types.Panel):
|
||||
bl_space_type = 'PROPERTIES'
|
||||
bl_region_type = 'WINDOW'
|
||||
bl_context = "world"
|
||||
# COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here
|
||||
|
||||
def poll(self, context):
|
||||
rd = context.scene.render_data
|
||||
return (context.world) and (not rd.use_game_engine) and (rd.engine in self.COMPAT_ENGINES)
|
||||
bl_space_type = 'PROPERTIES'
|
||||
bl_region_type = 'WINDOW'
|
||||
bl_context = "world"
|
||||
# COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here
|
||||
|
||||
def poll(self, context):
|
||||
rd = context.scene.render_data
|
||||
return (context.world) and (not rd.use_game_engine) and (rd.engine in self.COMPAT_ENGINES)
|
||||
|
||||
class WORLD_PT_preview(WorldButtonsPanel):
|
||||
bl_label = "Preview"
|
||||
COMPAT_ENGINES = set(['BLENDER_RENDER'])
|
||||
|
||||
def draw(self, context):
|
||||
self.layout.template_preview(context.world)
|
||||
|
||||
bl_label = "Preview"
|
||||
COMPAT_ENGINES = set(['BLENDER_RENDER'])
|
||||
|
||||
def draw(self, context):
|
||||
self.layout.template_preview(context.world)
|
||||
|
||||
class WORLD_PT_context_world(WorldButtonsPanel):
|
||||
bl_label = ""
|
||||
bl_show_header = False
|
||||
COMPAT_ENGINES = set(['BLENDER_RENDER'])
|
||||
bl_label = ""
|
||||
bl_show_header = False
|
||||
COMPAT_ENGINES = set(['BLENDER_RENDER'])
|
||||
|
||||
def poll(self, context):
|
||||
rd = context.scene.render_data
|
||||
return (not rd.use_game_engine) and (rd.engine in self.COMPAT_ENGINES)
|
||||
def poll(self, context):
|
||||
rd = context.scene.render_data
|
||||
return (not rd.use_game_engine) and (rd.engine in self.COMPAT_ENGINES)
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
scene = context.scene
|
||||
world = context.world
|
||||
space = context.space_data
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
split = layout.split(percentage=0.65)
|
||||
scene = context.scene
|
||||
world = context.world
|
||||
space = context.space_data
|
||||
|
||||
if scene:
|
||||
split.template_ID(scene, "world", new="world.new")
|
||||
elif world:
|
||||
split.template_ID(space, "pin_id")
|
||||
split = layout.split(percentage=0.65)
|
||||
|
||||
if scene:
|
||||
split.template_ID(scene, "world", new="world.new")
|
||||
elif world:
|
||||
split.template_ID(space, "pin_id")
|
||||
|
||||
class WORLD_PT_world(WorldButtonsPanel):
|
||||
bl_label = "World"
|
||||
COMPAT_ENGINES = set(['BLENDER_RENDER'])
|
||||
bl_label = "World"
|
||||
COMPAT_ENGINES = set(['BLENDER_RENDER'])
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
world = context.world
|
||||
world = context.world
|
||||
|
||||
row = layout.row()
|
||||
row.itemR(world, "paper_sky")
|
||||
row.itemR(world, "blend_sky")
|
||||
row.itemR(world, "real_sky")
|
||||
|
||||
row = layout.row()
|
||||
row.column().itemR(world, "horizon_color")
|
||||
col = row.column()
|
||||
col.itemR(world, "zenith_color")
|
||||
col.active = world.blend_sky
|
||||
row.column().itemR(world, "ambient_color")
|
||||
|
||||
row = layout.row()
|
||||
row.itemR(world, "paper_sky")
|
||||
row.itemR(world, "blend_sky")
|
||||
row.itemR(world, "real_sky")
|
||||
|
||||
row = layout.row()
|
||||
row.column().itemR(world, "horizon_color")
|
||||
col = row.column()
|
||||
col.itemR(world, "zenith_color")
|
||||
col.active = world.blend_sky
|
||||
row.column().itemR(world, "ambient_color")
|
||||
|
||||
class WORLD_PT_mist(WorldButtonsPanel):
|
||||
bl_label = "Mist"
|
||||
COMPAT_ENGINES = set(['BLENDER_RENDER'])
|
||||
bl_label = "Mist"
|
||||
COMPAT_ENGINES = set(['BLENDER_RENDER'])
|
||||
|
||||
def draw_header(self, context):
|
||||
world = context.world
|
||||
def draw_header(self, context):
|
||||
world = context.world
|
||||
|
||||
self.layout.itemR(world.mist, "enabled", text="")
|
||||
self.layout.itemR(world.mist, "enabled", text="")
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
world = context.world
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
layout.active = world.mist.enabled
|
||||
world = context.world
|
||||
|
||||
flow = layout.column_flow()
|
||||
flow.itemR(world.mist, "intensity", slider=True)
|
||||
flow.itemR(world.mist, "start")
|
||||
flow.itemR(world.mist, "depth")
|
||||
flow.itemR(world.mist, "height")
|
||||
layout.active = world.mist.enabled
|
||||
|
||||
flow = layout.column_flow()
|
||||
flow.itemR(world.mist, "intensity", slider=True)
|
||||
flow.itemR(world.mist, "start")
|
||||
flow.itemR(world.mist, "depth")
|
||||
flow.itemR(world.mist, "height")
|
||||
|
||||
layout.itemR(world.mist, "falloff")
|
||||
|
||||
layout.itemR(world.mist, "falloff")
|
||||
|
||||
class WORLD_PT_stars(WorldButtonsPanel):
|
||||
bl_label = "Stars"
|
||||
COMPAT_ENGINES = set(['BLENDER_RENDER'])
|
||||
bl_label = "Stars"
|
||||
COMPAT_ENGINES = set(['BLENDER_RENDER'])
|
||||
|
||||
def draw_header(self, context):
|
||||
world = context.world
|
||||
def draw_header(self, context):
|
||||
world = context.world
|
||||
|
||||
self.layout.itemR(world.stars, "enabled", text="")
|
||||
self.layout.itemR(world.stars, "enabled", text="")
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
world = context.world
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
layout.active = world.stars.enabled
|
||||
world = context.world
|
||||
|
||||
layout.active = world.stars.enabled
|
||||
|
||||
flow = layout.column_flow()
|
||||
flow.itemR(world.stars, "size")
|
||||
flow.itemR(world.stars, "color_randomization", text="Colors")
|
||||
flow.itemR(world.stars, "min_distance", text="Min. Dist")
|
||||
flow.itemR(world.stars, "average_separation", text="Separation")
|
||||
|
||||
flow = layout.column_flow()
|
||||
flow.itemR(world.stars, "size")
|
||||
flow.itemR(world.stars, "color_randomization", text="Colors")
|
||||
flow.itemR(world.stars, "min_distance", text="Min. Dist")
|
||||
flow.itemR(world.stars, "average_separation", text="Separation")
|
||||
|
||||
class WORLD_PT_ambient_occlusion(WorldButtonsPanel):
|
||||
bl_label = "Ambient Occlusion"
|
||||
COMPAT_ENGINES = set(['BLENDER_RENDER'])
|
||||
bl_label = "Ambient Occlusion"
|
||||
COMPAT_ENGINES = set(['BLENDER_RENDER'])
|
||||
|
||||
def draw_header(self, context):
|
||||
world = context.world
|
||||
def draw_header(self, context):
|
||||
world = context.world
|
||||
|
||||
self.layout.itemR(world.ambient_occlusion, "enabled", text="")
|
||||
self.layout.itemR(world.ambient_occlusion, "enabled", text="")
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
ao = context.world.ambient_occlusion
|
||||
|
||||
layout.active = ao.enabled
|
||||
|
||||
layout.itemR(ao, "gather_method", expand=True)
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Attenuation:")
|
||||
if ao.gather_method == 'RAYTRACE':
|
||||
col.itemR(ao, "distance")
|
||||
col.itemR(ao, "falloff")
|
||||
sub = col.row()
|
||||
sub.active = ao.falloff
|
||||
sub.itemR(ao, "falloff_strength", text="Strength")
|
||||
|
||||
if ao.gather_method == 'RAYTRACE':
|
||||
col = split.column()
|
||||
|
||||
col.itemL(text="Sampling:")
|
||||
col.itemR(ao, "sample_method", text="")
|
||||
ao = context.world.ambient_occlusion
|
||||
|
||||
sub = col.column()
|
||||
sub.itemR(ao, "samples")
|
||||
layout.active = ao.enabled
|
||||
|
||||
if ao.sample_method == 'ADAPTIVE_QMC':
|
||||
sub.itemR(ao, "threshold")
|
||||
sub.itemR(ao, "adapt_to_speed", slider=True)
|
||||
elif ao.sample_method == 'CONSTANT_JITTERED':
|
||||
sub.itemR(ao, "bias")
|
||||
|
||||
if ao.gather_method == 'APPROXIMATE':
|
||||
col = split.column()
|
||||
|
||||
col.itemL(text="Sampling:")
|
||||
col.itemR(ao, "passes")
|
||||
col.itemR(ao, "error_tolerance", text="Error")
|
||||
col.itemR(ao, "pixel_cache")
|
||||
col.itemR(ao, "correction")
|
||||
|
||||
col = layout.column()
|
||||
col.itemL(text="Influence:")
|
||||
|
||||
col.row().itemR(ao, "blend_mode", expand=True)
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.itemR(ao, "energy")
|
||||
|
||||
col = split.column()
|
||||
sub = col.split(percentage=0.3)
|
||||
sub.itemL(text="Color:")
|
||||
sub.itemR(ao, "color", text="")
|
||||
layout.itemR(ao, "gather_method", expand=True)
|
||||
|
||||
bpy.types.register(WORLD_PT_context_world)
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Attenuation:")
|
||||
if ao.gather_method == 'RAYTRACE':
|
||||
col.itemR(ao, "distance")
|
||||
col.itemR(ao, "falloff")
|
||||
sub = col.row()
|
||||
sub.active = ao.falloff
|
||||
sub.itemR(ao, "falloff_strength", text="Strength")
|
||||
|
||||
if ao.gather_method == 'RAYTRACE':
|
||||
col = split.column()
|
||||
|
||||
col.itemL(text="Sampling:")
|
||||
col.itemR(ao, "sample_method", text="")
|
||||
|
||||
sub = col.column()
|
||||
sub.itemR(ao, "samples")
|
||||
|
||||
if ao.sample_method == 'ADAPTIVE_QMC':
|
||||
sub.itemR(ao, "threshold")
|
||||
sub.itemR(ao, "adapt_to_speed", slider=True)
|
||||
elif ao.sample_method == 'CONSTANT_JITTERED':
|
||||
sub.itemR(ao, "bias")
|
||||
|
||||
if ao.gather_method == 'APPROXIMATE':
|
||||
col = split.column()
|
||||
|
||||
col.itemL(text="Sampling:")
|
||||
col.itemR(ao, "passes")
|
||||
col.itemR(ao, "error_tolerance", text="Error")
|
||||
col.itemR(ao, "pixel_cache")
|
||||
col.itemR(ao, "correction")
|
||||
|
||||
col = layout.column()
|
||||
col.itemL(text="Influence:")
|
||||
|
||||
col.row().itemR(ao, "blend_mode", expand=True)
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.itemR(ao, "energy")
|
||||
|
||||
col = split.column()
|
||||
sub = col.split(percentage=0.3)
|
||||
sub.itemL(text="Color:")
|
||||
sub.itemR(ao, "color", text="")
|
||||
|
||||
bpy.types.register(WORLD_PT_context_world)
|
||||
bpy.types.register(WORLD_PT_preview)
|
||||
bpy.types.register(WORLD_PT_world)
|
||||
bpy.types.register(WORLD_PT_ambient_occlusion)
|
||||
|
@ -2,34 +2,34 @@
|
||||
import bpy
|
||||
|
||||
class Buttons_HT_header(bpy.types.Header):
|
||||
bl_space_type = 'PROPERTIES'
|
||||
bl_space_type = 'PROPERTIES'
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
so = context.space_data
|
||||
scene = context.scene
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
row= layout.row(align=True)
|
||||
row.template_header()
|
||||
so = context.space_data
|
||||
scene = context.scene
|
||||
|
||||
if context.area.show_menus:
|
||||
sub = row.row(align=True)
|
||||
sub.itemM("Buttons_MT_view", text="View")
|
||||
|
||||
row = layout.row()
|
||||
row.itemR(so, "buttons_context", expand=True, text="")
|
||||
row.itemR(scene, "current_frame")
|
||||
row= layout.row(align=True)
|
||||
row.template_header()
|
||||
|
||||
if context.area.show_menus:
|
||||
sub = row.row(align=True)
|
||||
sub.itemM("Buttons_MT_view", text="View")
|
||||
|
||||
row = layout.row()
|
||||
row.itemR(so, "buttons_context", expand=True, text="")
|
||||
row.itemR(scene, "current_frame")
|
||||
|
||||
class Buttons_MT_view(bpy.types.Menu):
|
||||
bl_label = "View"
|
||||
bl_label = "View"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
so = context.space_data
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
so = context.space_data
|
||||
|
||||
col = layout.column()
|
||||
col.itemR(so, "panel_alignment", expand=True)
|
||||
col = layout.column()
|
||||
col.itemR(so, "panel_alignment", expand=True)
|
||||
|
||||
bpy.types.register(Buttons_HT_header)
|
||||
bpy.types.register(Buttons_MT_view)
|
||||
|
@ -2,47 +2,47 @@
|
||||
import bpy
|
||||
|
||||
class FILEBROWSER_HT_header(bpy.types.Header):
|
||||
bl_space_type = 'FILE_BROWSER'
|
||||
bl_space_type = 'FILE_BROWSER'
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
st = context.space_data
|
||||
params = st.params
|
||||
|
||||
layout.template_header(menus=False)
|
||||
|
||||
row = layout.row()
|
||||
row.itemS()
|
||||
|
||||
row = layout.row(align=True)
|
||||
row.itemO("file.previous", text="", icon='ICON_BACK')
|
||||
row.itemO("file.next", text="", icon='ICON_FORWARD')
|
||||
row.itemO("file.parent", text="", icon='ICON_FILE_PARENT')
|
||||
row.itemO("file.refresh", text="", icon='ICON_FILE_REFRESH')
|
||||
|
||||
row = layout.row()
|
||||
row.itemS()
|
||||
|
||||
row = layout.row(align=True)
|
||||
row.itemO("file.directory_new", text="", icon='ICON_NEWFOLDER')
|
||||
|
||||
layout.itemR(params, "display", expand=True, text="")
|
||||
layout.itemR(params, "sort", expand=True, text="")
|
||||
|
||||
layout.itemR(params, "hide_dot", text="Hide Invisible")
|
||||
layout.itemR(params, "do_filter", text="", icon='ICON_FILTER')
|
||||
|
||||
row = layout.row(align=True)
|
||||
row.active = params.do_filter
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
row.itemR(params, "filter_folder", text="");
|
||||
row.itemR(params, "filter_blender", text="");
|
||||
row.itemR(params, "filter_image", text="");
|
||||
row.itemR(params, "filter_movie", text="");
|
||||
row.itemR(params, "filter_script", text="");
|
||||
row.itemR(params, "filter_font", text="");
|
||||
row.itemR(params, "filter_sound", text="");
|
||||
row.itemR(params, "filter_text", text="");
|
||||
st = context.space_data
|
||||
params = st.params
|
||||
|
||||
layout.template_header(menus=False)
|
||||
|
||||
row = layout.row()
|
||||
row.itemS()
|
||||
|
||||
row = layout.row(align=True)
|
||||
row.itemO("file.previous", text="", icon='ICON_BACK')
|
||||
row.itemO("file.next", text="", icon='ICON_FORWARD')
|
||||
row.itemO("file.parent", text="", icon='ICON_FILE_PARENT')
|
||||
row.itemO("file.refresh", text="", icon='ICON_FILE_REFRESH')
|
||||
|
||||
row = layout.row()
|
||||
row.itemS()
|
||||
|
||||
row = layout.row(align=True)
|
||||
row.itemO("file.directory_new", text="", icon='ICON_NEWFOLDER')
|
||||
|
||||
layout.itemR(params, "display", expand=True, text="")
|
||||
layout.itemR(params, "sort", expand=True, text="")
|
||||
|
||||
layout.itemR(params, "hide_dot", text="Hide Invisible")
|
||||
layout.itemR(params, "do_filter", text="", icon='ICON_FILTER')
|
||||
|
||||
row = layout.row(align=True)
|
||||
row.active = params.do_filter
|
||||
|
||||
row.itemR(params, "filter_folder", text="");
|
||||
row.itemR(params, "filter_blender", text="");
|
||||
row.itemR(params, "filter_image", text="");
|
||||
row.itemR(params, "filter_movie", text="");
|
||||
row.itemR(params, "filter_script", text="");
|
||||
row.itemR(params, "filter_font", text="");
|
||||
row.itemR(params, "filter_sound", text="");
|
||||
row.itemR(params, "filter_text", text="");
|
||||
|
||||
bpy.types.register(FILEBROWSER_HT_header)
|
||||
|
@ -2,480 +2,480 @@
|
||||
import bpy
|
||||
|
||||
class IMAGE_MT_view(bpy.types.Menu):
|
||||
bl_label = "View"
|
||||
bl_label = "View"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
sima = context.space_data
|
||||
uv = sima.uv_editor
|
||||
settings = context.tool_settings
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
show_uvedit = sima.show_uvedit
|
||||
sima = context.space_data
|
||||
uv = sima.uv_editor
|
||||
settings = context.tool_settings
|
||||
|
||||
layout.itemO("image.properties", icon='ICON_MENU_PANEL')
|
||||
show_uvedit = sima.show_uvedit
|
||||
|
||||
layout.itemS()
|
||||
layout.itemO("image.properties", icon='ICON_MENU_PANEL')
|
||||
|
||||
layout.itemR(sima, "update_automatically")
|
||||
if show_uvedit:
|
||||
layout.itemR(settings, "uv_local_view") # Numpad /
|
||||
layout.itemS()
|
||||
|
||||
layout.itemS()
|
||||
layout.itemR(sima, "update_automatically")
|
||||
if show_uvedit:
|
||||
layout.itemR(settings, "uv_local_view") # Numpad /
|
||||
|
||||
layout.itemO("image.view_zoom_in")
|
||||
layout.itemO("image.view_zoom_out")
|
||||
layout.itemS()
|
||||
|
||||
layout.itemS()
|
||||
layout.itemO("image.view_zoom_in")
|
||||
layout.itemO("image.view_zoom_out")
|
||||
|
||||
ratios = [[1, 8], [1, 4], [1, 2], [1, 1], [2, 1], [4, 1], [8, 1]];
|
||||
layout.itemS()
|
||||
|
||||
for a, b in ratios:
|
||||
text = "Zoom %d:%d" % (a, b)
|
||||
layout.item_floatO("image.view_zoom_ratio", "ratio", a/b, text=text)
|
||||
ratios = [[1, 8], [1, 4], [1, 2], [1, 1], [2, 1], [4, 1], [8, 1]];
|
||||
|
||||
layout.itemS()
|
||||
for a, b in ratios:
|
||||
text = "Zoom %d:%d" % (a, b)
|
||||
layout.item_floatO("image.view_zoom_ratio", "ratio", a/b, text=text)
|
||||
|
||||
if show_uvedit:
|
||||
layout.itemO("image.view_selected")
|
||||
layout.itemS()
|
||||
|
||||
layout.itemO("image.view_all")
|
||||
layout.itemO("screen.screen_full_area")
|
||||
if show_uvedit:
|
||||
layout.itemO("image.view_selected")
|
||||
|
||||
layout.itemO("image.view_all")
|
||||
layout.itemO("screen.screen_full_area")
|
||||
|
||||
class IMAGE_MT_select(bpy.types.Menu):
|
||||
bl_label = "Select"
|
||||
bl_label = "Select"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
layout.itemO("uv.select_border")
|
||||
layout.item_booleanO("uv.select_border", "pinned", True)
|
||||
layout.itemO("uv.select_border")
|
||||
layout.item_booleanO("uv.select_border", "pinned", True)
|
||||
|
||||
layout.itemS()
|
||||
|
||||
layout.itemO("uv.select_all_toggle")
|
||||
layout.itemO("uv.select_inverse")
|
||||
layout.itemO("uv.unlink_selection")
|
||||
|
||||
layout.itemS()
|
||||
layout.itemS()
|
||||
|
||||
layout.itemO("uv.select_pinned")
|
||||
layout.itemO("uv.select_linked")
|
||||
layout.itemO("uv.select_all_toggle")
|
||||
layout.itemO("uv.select_inverse")
|
||||
layout.itemO("uv.unlink_selection")
|
||||
|
||||
layout.itemS()
|
||||
|
||||
layout.itemO("uv.select_pinned")
|
||||
layout.itemO("uv.select_linked")
|
||||
|
||||
class IMAGE_MT_image(bpy.types.Menu):
|
||||
bl_label = "Image"
|
||||
bl_label = "Image"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
sima = context.space_data
|
||||
ima = sima.image
|
||||
sima = context.space_data
|
||||
ima = sima.image
|
||||
|
||||
layout.itemO("image.new")
|
||||
layout.itemO("image.open")
|
||||
layout.itemO("image.new")
|
||||
layout.itemO("image.open")
|
||||
|
||||
show_render = sima.show_render
|
||||
show_render = sima.show_render
|
||||
|
||||
if ima:
|
||||
if not show_render:
|
||||
layout.itemO("image.replace")
|
||||
layout.itemO("image.reload")
|
||||
if ima:
|
||||
if not show_render:
|
||||
layout.itemO("image.replace")
|
||||
layout.itemO("image.reload")
|
||||
|
||||
layout.itemO("image.save")
|
||||
layout.itemO("image.save_as")
|
||||
layout.itemO("image.save")
|
||||
layout.itemO("image.save_as")
|
||||
|
||||
if ima.source == 'SEQUENCE':
|
||||
layout.itemO("image.save_sequence")
|
||||
if ima.source == 'SEQUENCE':
|
||||
layout.itemO("image.save_sequence")
|
||||
|
||||
if not show_render:
|
||||
layout.itemS()
|
||||
if not show_render:
|
||||
layout.itemS()
|
||||
|
||||
if ima.packed_file:
|
||||
layout.itemO("image.unpack")
|
||||
else:
|
||||
layout.itemO("image.pack")
|
||||
if ima.packed_file:
|
||||
layout.itemO("image.unpack")
|
||||
else:
|
||||
layout.itemO("image.pack")
|
||||
|
||||
# only for dirty && specific image types, perhaps
|
||||
# this could be done in operator poll too
|
||||
if ima.dirty:
|
||||
if ima.source in ('FILE', 'GENERATED') and ima.type != 'MULTILAYER':
|
||||
layout.item_booleanO("image.pack", "as_png", True, text="Pack As PNG")
|
||||
# only for dirty && specific image types, perhaps
|
||||
# this could be done in operator poll too
|
||||
if ima.dirty:
|
||||
if ima.source in ('FILE', 'GENERATED') and ima.type != 'MULTILAYER':
|
||||
layout.item_booleanO("image.pack", "as_png", True, text="Pack As PNG")
|
||||
|
||||
layout.itemS()
|
||||
layout.itemS()
|
||||
|
||||
layout.itemR(sima, "image_painting")
|
||||
layout.itemR(sima, "image_painting")
|
||||
|
||||
class IMAGE_MT_uvs_showhide(bpy.types.Menu):
|
||||
bl_label = "Show/Hide Faces"
|
||||
bl_label = "Show/Hide Faces"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
layout.itemO("uv.reveal")
|
||||
layout.itemO("uv.hide")
|
||||
layout.item_booleanO("uv.hide", "unselected", True)
|
||||
layout.itemO("uv.reveal")
|
||||
layout.itemO("uv.hide")
|
||||
layout.item_booleanO("uv.hide", "unselected", True)
|
||||
|
||||
class IMAGE_MT_uvs_transform(bpy.types.Menu):
|
||||
bl_label = "Transform"
|
||||
bl_label = "Transform"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
layout.itemO("tfm.translate")
|
||||
layout.itemO("tfm.rotate")
|
||||
layout.itemO("tfm.resize")
|
||||
layout.itemO("tfm.translate")
|
||||
layout.itemO("tfm.rotate")
|
||||
layout.itemO("tfm.resize")
|
||||
|
||||
class IMAGE_MT_uvs_mirror(bpy.types.Menu):
|
||||
bl_label = "Mirror"
|
||||
bl_label = "Mirror"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.operator_context = "EXEC_REGION_WIN"
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.operator_context = "EXEC_REGION_WIN"
|
||||
|
||||
props= layout.itemO("tfm.mirror", text="X Axis", properties=True)
|
||||
props.constraint_axis[0]= True
|
||||
props= layout.itemO("tfm.mirror", text="X Axis", properties=True)
|
||||
props.constraint_axis[0]= True
|
||||
|
||||
props= layout.itemO("tfm.mirror", text="Y Axis", properties=True)
|
||||
props.constraint_axis[1]= True
|
||||
props= layout.itemO("tfm.mirror", text="Y Axis", properties=True)
|
||||
props.constraint_axis[1]= True
|
||||
|
||||
class IMAGE_MT_uvs_weldalign(bpy.types.Menu):
|
||||
bl_label = "Weld/Align"
|
||||
bl_label = "Weld/Align"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
layout.itemO("uv.weld") # W, 1
|
||||
layout.items_enumO("uv.align", "axis") # W, 2/3/4
|
||||
layout.itemO("uv.weld") # W, 1
|
||||
layout.items_enumO("uv.align", "axis") # W, 2/3/4
|
||||
|
||||
class IMAGE_MT_uvs(bpy.types.Menu):
|
||||
bl_label = "UVs"
|
||||
bl_label = "UVs"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
sima = context.space_data
|
||||
uv = sima.uv_editor
|
||||
settings = context.tool_settings
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
layout.itemR(uv, "snap_to_pixels")
|
||||
layout.itemR(uv, "constrain_to_image_bounds")
|
||||
sima = context.space_data
|
||||
uv = sima.uv_editor
|
||||
settings = context.tool_settings
|
||||
|
||||
layout.itemS()
|
||||
layout.itemR(uv, "snap_to_pixels")
|
||||
layout.itemR(uv, "constrain_to_image_bounds")
|
||||
|
||||
layout.itemR(uv, "live_unwrap")
|
||||
layout.itemO("uv.unwrap")
|
||||
layout.item_booleanO("uv.pin", "clear", True, text="Unpin")
|
||||
layout.itemO("uv.pin")
|
||||
layout.itemS()
|
||||
|
||||
layout.itemS()
|
||||
layout.itemR(uv, "live_unwrap")
|
||||
layout.itemO("uv.unwrap")
|
||||
layout.item_booleanO("uv.pin", "clear", True, text="Unpin")
|
||||
layout.itemO("uv.pin")
|
||||
|
||||
layout.itemO("uv.pack_islands")
|
||||
layout.itemO("uv.average_islands_scale")
|
||||
layout.itemO("uv.minimize_stretch")
|
||||
layout.itemO("uv.stitch")
|
||||
layout.itemS()
|
||||
|
||||
layout.itemS()
|
||||
layout.itemO("uv.pack_islands")
|
||||
layout.itemO("uv.average_islands_scale")
|
||||
layout.itemO("uv.minimize_stretch")
|
||||
layout.itemO("uv.stitch")
|
||||
|
||||
layout.itemM("IMAGE_MT_uvs_transform")
|
||||
layout.itemM("IMAGE_MT_uvs_mirror")
|
||||
layout.itemM("IMAGE_MT_uvs_weldalign")
|
||||
layout.itemS()
|
||||
|
||||
layout.itemS()
|
||||
layout.itemM("IMAGE_MT_uvs_transform")
|
||||
layout.itemM("IMAGE_MT_uvs_mirror")
|
||||
layout.itemM("IMAGE_MT_uvs_weldalign")
|
||||
|
||||
layout.itemR(settings, "proportional_editing")
|
||||
layout.item_menu_enumR(settings, "proportional_editing_falloff")
|
||||
layout.itemS()
|
||||
|
||||
layout.itemS()
|
||||
layout.itemR(settings, "proportional_editing")
|
||||
layout.item_menu_enumR(settings, "proportional_editing_falloff")
|
||||
|
||||
layout.itemM("IMAGE_MT_uvs_showhide")
|
||||
layout.itemS()
|
||||
|
||||
layout.itemM("IMAGE_MT_uvs_showhide")
|
||||
|
||||
class IMAGE_HT_header(bpy.types.Header):
|
||||
bl_space_type = 'IMAGE_EDITOR'
|
||||
bl_space_type = 'IMAGE_EDITOR'
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
sima = context.space_data
|
||||
ima = sima.image
|
||||
iuser = sima.image_user
|
||||
settings = context.tool_settings
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
show_render = sima.show_render
|
||||
show_paint = sima.show_paint
|
||||
show_uvedit = sima.show_uvedit
|
||||
sima = context.space_data
|
||||
ima = sima.image
|
||||
iuser = sima.image_user
|
||||
settings = context.tool_settings
|
||||
|
||||
row = layout.row(align=True)
|
||||
row.template_header()
|
||||
show_render = sima.show_render
|
||||
show_paint = sima.show_paint
|
||||
show_uvedit = sima.show_uvedit
|
||||
|
||||
# menus
|
||||
if context.area.show_menus:
|
||||
sub = row.row(align=True)
|
||||
sub.itemM("IMAGE_MT_view")
|
||||
row = layout.row(align=True)
|
||||
row.template_header()
|
||||
|
||||
if show_uvedit:
|
||||
sub.itemM("IMAGE_MT_select")
|
||||
# menus
|
||||
if context.area.show_menus:
|
||||
sub = row.row(align=True)
|
||||
sub.itemM("IMAGE_MT_view")
|
||||
|
||||
if ima and ima.dirty:
|
||||
sub.itemM("IMAGE_MT_image", text="Image*")
|
||||
else:
|
||||
sub.itemM("IMAGE_MT_image", text="Image")
|
||||
if show_uvedit:
|
||||
sub.itemM("IMAGE_MT_select")
|
||||
|
||||
if show_uvedit:
|
||||
sub.itemM("IMAGE_MT_uvs")
|
||||
if ima and ima.dirty:
|
||||
sub.itemM("IMAGE_MT_image", text="Image*")
|
||||
else:
|
||||
sub.itemM("IMAGE_MT_image", text="Image")
|
||||
|
||||
layout.template_ID(sima, "image", new="image.new")
|
||||
if show_uvedit:
|
||||
sub.itemM("IMAGE_MT_uvs")
|
||||
|
||||
# uv editing
|
||||
if show_uvedit:
|
||||
uvedit = sima.uv_editor
|
||||
layout.template_ID(sima, "image", new="image.new")
|
||||
|
||||
layout.itemR(uvedit, "pivot", text="", icon_only=True)
|
||||
layout.itemR(settings, "uv_sync_selection", text="")
|
||||
# uv editing
|
||||
if show_uvedit:
|
||||
uvedit = sima.uv_editor
|
||||
|
||||
if settings.uv_sync_selection:
|
||||
layout.itemR(settings, "mesh_selection_mode", text="", expand=True)
|
||||
else:
|
||||
layout.itemR(settings, "uv_selection_mode", text="", expand=True)
|
||||
layout.itemR(uvedit, "sticky_selection_mode", text="", icon_only=True)
|
||||
pass
|
||||
layout.itemR(uvedit, "pivot", text="", icon_only=True)
|
||||
layout.itemR(settings, "uv_sync_selection", text="")
|
||||
|
||||
row = layout.row(align=True)
|
||||
row.itemR(settings, "snap", text="")
|
||||
if settings.snap:
|
||||
row.itemR(settings, "snap_mode", text="")
|
||||
if settings.uv_sync_selection:
|
||||
layout.itemR(settings, "mesh_selection_mode", text="", expand=True)
|
||||
else:
|
||||
layout.itemR(settings, "uv_selection_mode", text="", expand=True)
|
||||
layout.itemR(uvedit, "sticky_selection_mode", text="", icon_only=True)
|
||||
pass
|
||||
|
||||
"""
|
||||
mesh = context.edit_object.data
|
||||
row.item_pointerR(mesh, "active_uv_layer", mesh, "uv_textures")
|
||||
"""
|
||||
row = layout.row(align=True)
|
||||
row.itemR(settings, "snap", text="")
|
||||
if settings.snap:
|
||||
row.itemR(settings, "snap_mode", text="")
|
||||
|
||||
if ima:
|
||||
# layers
|
||||
layout.template_image_layers(ima, iuser)
|
||||
"""
|
||||
mesh = context.edit_object.data
|
||||
row.item_pointerR(mesh, "active_uv_layer", mesh, "uv_textures")
|
||||
"""
|
||||
|
||||
# painting
|
||||
layout.itemR(sima, "image_painting", text="")
|
||||
if ima:
|
||||
# layers
|
||||
layout.template_image_layers(ima, iuser)
|
||||
|
||||
# draw options
|
||||
row = layout.row(align=True)
|
||||
row.itemR(sima, "draw_channels", text="", expand=True)
|
||||
# painting
|
||||
layout.itemR(sima, "image_painting", text="")
|
||||
|
||||
row = layout.row(align=True)
|
||||
if ima.type == 'COMPOSITE':
|
||||
row.itemO("image.record_composite", icon='ICON_REC')
|
||||
if ima.type == 'COMPOSITE' and ima.source in ('MOVIE', 'SEQUENCE'):
|
||||
row.itemO("image.play_composite", icon='ICON_PLAY')
|
||||
|
||||
if show_uvedit or sima.image_painting:
|
||||
layout.itemR(sima, "update_automatically", text="")
|
||||
# draw options
|
||||
row = layout.row(align=True)
|
||||
row.itemR(sima, "draw_channels", text="", expand=True)
|
||||
|
||||
row = layout.row(align=True)
|
||||
if ima.type == 'COMPOSITE':
|
||||
row.itemO("image.record_composite", icon='ICON_REC')
|
||||
if ima.type == 'COMPOSITE' and ima.source in ('MOVIE', 'SEQUENCE'):
|
||||
row.itemO("image.play_composite", icon='ICON_PLAY')
|
||||
|
||||
if show_uvedit or sima.image_painting:
|
||||
layout.itemR(sima, "update_automatically", text="")
|
||||
|
||||
class IMAGE_PT_image_properties(bpy.types.Panel):
|
||||
bl_space_type = 'IMAGE_EDITOR'
|
||||
bl_region_type = 'UI'
|
||||
bl_label = "Image"
|
||||
bl_space_type = 'IMAGE_EDITOR'
|
||||
bl_region_type = 'UI'
|
||||
bl_label = "Image"
|
||||
|
||||
def poll(self, context):
|
||||
sima = context.space_data
|
||||
return (sima.image)
|
||||
def poll(self, context):
|
||||
sima = context.space_data
|
||||
return (sima.image)
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
sima = context.space_data
|
||||
ima = sima.image
|
||||
iuser = sima.image_user
|
||||
sima = context.space_data
|
||||
ima = sima.image
|
||||
iuser = sima.image_user
|
||||
|
||||
layout.template_image(sima, "image", iuser, compact=True)
|
||||
layout.template_image(sima, "image", iuser, compact=True)
|
||||
|
||||
class IMAGE_PT_game_properties(bpy.types.Panel):
|
||||
bl_space_type = 'IMAGE_EDITOR'
|
||||
bl_region_type = 'UI'
|
||||
bl_label = "Game Properties"
|
||||
bl_space_type = 'IMAGE_EDITOR'
|
||||
bl_region_type = 'UI'
|
||||
bl_label = "Game Properties"
|
||||
|
||||
def poll(self, context):
|
||||
rd = context.scene.render_data
|
||||
sima = context.space_data
|
||||
return (sima and sima.image) and (rd.engine == 'BLENDER_GAME')
|
||||
def poll(self, context):
|
||||
rd = context.scene.render_data
|
||||
sima = context.space_data
|
||||
return (sima and sima.image) and (rd.engine == 'BLENDER_GAME')
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
sima = context.space_data
|
||||
ima = sima.image
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
split = layout.split()
|
||||
sima = context.space_data
|
||||
ima = sima.image
|
||||
|
||||
col = split.column()
|
||||
|
||||
sub = col.column(align=True)
|
||||
sub.itemR(ima, "animated")
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
|
||||
sub = col.column(align=True)
|
||||
sub.itemR(ima, "animated")
|
||||
|
||||
subsub = sub.column()
|
||||
subsub.active = ima.animated
|
||||
subsub.itemR(ima, "animation_start", text="Start")
|
||||
subsub.itemR(ima, "animation_end", text="End")
|
||||
subsub.itemR(ima, "animation_speed", text="Speed")
|
||||
|
||||
col.itemR(ima, "tiles")
|
||||
sub = col.column(align=True)
|
||||
sub.active = ima.tiles or ima.animated
|
||||
sub.itemR(ima, "tiles_x", text="X")
|
||||
sub.itemR(ima, "tiles_y", text="Y")
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Clamp:")
|
||||
col.itemR(ima, "clamp_x", text="X")
|
||||
col.itemR(ima, "clamp_y", text="Y")
|
||||
col.itemS()
|
||||
col.itemR(ima, "mapping", expand=True)
|
||||
|
||||
subsub = sub.column()
|
||||
subsub.active = ima.animated
|
||||
subsub.itemR(ima, "animation_start", text="Start")
|
||||
subsub.itemR(ima, "animation_end", text="End")
|
||||
subsub.itemR(ima, "animation_speed", text="Speed")
|
||||
|
||||
col.itemR(ima, "tiles")
|
||||
sub = col.column(align=True)
|
||||
sub.active = ima.tiles or ima.animated
|
||||
sub.itemR(ima, "tiles_x", text="X")
|
||||
sub.itemR(ima, "tiles_y", text="Y")
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Clamp:")
|
||||
col.itemR(ima, "clamp_x", text="X")
|
||||
col.itemR(ima, "clamp_y", text="Y")
|
||||
col.itemS()
|
||||
col.itemR(ima, "mapping", expand=True)
|
||||
|
||||
|
||||
|
||||
class IMAGE_PT_view_properties(bpy.types.Panel):
|
||||
bl_space_type = 'IMAGE_EDITOR'
|
||||
bl_region_type = 'UI'
|
||||
bl_label = "Display"
|
||||
bl_space_type = 'IMAGE_EDITOR'
|
||||
bl_region_type = 'UI'
|
||||
bl_label = "Display"
|
||||
|
||||
def poll(self, context):
|
||||
sima = context.space_data
|
||||
return (sima and (sima.image or sima.show_uvedit))
|
||||
def poll(self, context):
|
||||
sima = context.space_data
|
||||
return (sima and (sima.image or sima.show_uvedit))
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
sima = context.space_data
|
||||
ima = sima.image
|
||||
show_uvedit = sima.show_uvedit
|
||||
uvedit = sima.uv_editor
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
split = layout.split()
|
||||
sima = context.space_data
|
||||
ima = sima.image
|
||||
show_uvedit = sima.show_uvedit
|
||||
uvedit = sima.uv_editor
|
||||
|
||||
col = split.column()
|
||||
if ima:
|
||||
col.itemR(ima, "display_aspect", text="Aspect Ratio")
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.itemL(text="Coordinates:")
|
||||
col.itemR(sima, "draw_repeated", text="Repeat")
|
||||
if show_uvedit:
|
||||
col.itemR(uvedit, "normalized_coordinates", text="Normalized")
|
||||
elif show_uvedit:
|
||||
col.itemL(text="Coordinates:")
|
||||
col.itemR(uvedit, "normalized_coordinates", text="Normalized")
|
||||
col = split.column()
|
||||
if ima:
|
||||
col.itemR(ima, "display_aspect", text="Aspect Ratio")
|
||||
|
||||
if show_uvedit:
|
||||
|
||||
col = layout.column()
|
||||
col.itemL(text="UVs:")
|
||||
row = col.row()
|
||||
row.itemR(uvedit, "edge_draw_type", expand=True)
|
||||
|
||||
split = layout.split()
|
||||
col = split.column()
|
||||
col.itemL(text="Coordinates:")
|
||||
col.itemR(sima, "draw_repeated", text="Repeat")
|
||||
if show_uvedit:
|
||||
col.itemR(uvedit, "normalized_coordinates", text="Normalized")
|
||||
elif show_uvedit:
|
||||
col.itemL(text="Coordinates:")
|
||||
col.itemR(uvedit, "normalized_coordinates", text="Normalized")
|
||||
|
||||
col = split.column()
|
||||
col.itemR(uvedit, "draw_stretch", text="Stretch")
|
||||
sub = col.column()
|
||||
sub.active = uvedit.draw_stretch
|
||||
sub.row().itemR(uvedit, "draw_stretch_type", expand=True)
|
||||
|
||||
col = split.column()
|
||||
col.itemR(uvedit, "draw_smooth_edges", text="Smooth")
|
||||
col.itemR(uvedit, "draw_modified_edges", text="Modified")
|
||||
#col.itemR(uvedit, "draw_edges")
|
||||
#col.itemR(uvedit, "draw_faces")
|
||||
if show_uvedit:
|
||||
|
||||
col = layout.column()
|
||||
col.itemL(text="UVs:")
|
||||
row = col.row()
|
||||
row.itemR(uvedit, "edge_draw_type", expand=True)
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.itemR(uvedit, "draw_stretch", text="Stretch")
|
||||
sub = col.column()
|
||||
sub.active = uvedit.draw_stretch
|
||||
sub.row().itemR(uvedit, "draw_stretch_type", expand=True)
|
||||
|
||||
col = split.column()
|
||||
col.itemR(uvedit, "draw_smooth_edges", text="Smooth")
|
||||
col.itemR(uvedit, "draw_modified_edges", text="Modified")
|
||||
#col.itemR(uvedit, "draw_edges")
|
||||
#col.itemR(uvedit, "draw_faces")
|
||||
|
||||
class IMAGE_PT_paint(bpy.types.Panel):
|
||||
bl_space_type = 'IMAGE_EDITOR'
|
||||
bl_region_type = 'UI'
|
||||
bl_label = "Paint"
|
||||
bl_space_type = 'IMAGE_EDITOR'
|
||||
bl_region_type = 'UI'
|
||||
bl_label = "Paint"
|
||||
|
||||
def poll(self, context):
|
||||
sima = context.space_data
|
||||
return sima.show_paint
|
||||
def poll(self, context):
|
||||
sima = context.space_data
|
||||
return sima.show_paint
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
settings = context.tool_settings.image_paint
|
||||
brush = settings.brush
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
col = layout.split().column()
|
||||
row = col.row()
|
||||
row.template_list(settings, "brushes", settings, "active_brush_index", rows=2)
|
||||
|
||||
col.template_ID(settings, "brush", new="brush.add")
|
||||
settings = context.tool_settings.image_paint
|
||||
brush = settings.brush
|
||||
|
||||
row = layout.row(align=True)
|
||||
row.item_enumR(settings, "tool", 'DRAW')
|
||||
row.item_enumR(settings, "tool", 'SOFTEN')
|
||||
row.item_enumR(settings, "tool", 'CLONE')
|
||||
row.item_enumR(settings, "tool", 'SMEAR')
|
||||
|
||||
if brush:
|
||||
col = layout.column()
|
||||
col.itemR(brush, "color", text="")
|
||||
col = layout.split().column()
|
||||
row = col.row()
|
||||
row.template_list(settings, "brushes", settings, "active_brush_index", rows=2)
|
||||
|
||||
row = col.row(align=True)
|
||||
row.itemR(brush, "size", slider=True)
|
||||
row.itemR(brush, "use_size_pressure", toggle=True, text="")
|
||||
|
||||
row = col.row(align=True)
|
||||
row.itemR(brush, "strength", slider=True)
|
||||
row.itemR(brush, "use_strength_pressure", toggle=True, text="")
|
||||
col.template_ID(settings, "brush", new="brush.add")
|
||||
|
||||
row = col.row(align=True)
|
||||
row.itemR(brush, "jitter", slider=True)
|
||||
row.itemR(brush, "use_jitter_pressure", toggle=True, text="")
|
||||
row = layout.row(align=True)
|
||||
row.item_enumR(settings, "tool", 'DRAW')
|
||||
row.item_enumR(settings, "tool", 'SOFTEN')
|
||||
row.item_enumR(settings, "tool", 'CLONE')
|
||||
row.item_enumR(settings, "tool", 'SMEAR')
|
||||
|
||||
col.itemR(brush, "blend", text="Blend")
|
||||
if brush:
|
||||
col = layout.column()
|
||||
col.itemR(brush, "color", text="")
|
||||
|
||||
row = col.row(align=True)
|
||||
row.itemR(brush, "size", slider=True)
|
||||
row.itemR(brush, "use_size_pressure", toggle=True, text="")
|
||||
|
||||
row = col.row(align=True)
|
||||
row.itemR(brush, "strength", slider=True)
|
||||
row.itemR(brush, "use_strength_pressure", toggle=True, text="")
|
||||
|
||||
row = col.row(align=True)
|
||||
row.itemR(brush, "jitter", slider=True)
|
||||
row.itemR(brush, "use_jitter_pressure", toggle=True, text="")
|
||||
|
||||
col.itemR(brush, "blend", text="Blend")
|
||||
|
||||
class IMAGE_PT_paint_stroke(bpy.types.Panel):
|
||||
bl_space_type = 'IMAGE_EDITOR'
|
||||
bl_region_type = 'UI'
|
||||
bl_label = "Paint Stroke"
|
||||
bl_default_closed = True
|
||||
bl_space_type = 'IMAGE_EDITOR'
|
||||
bl_region_type = 'UI'
|
||||
bl_label = "Paint Stroke"
|
||||
bl_default_closed = True
|
||||
|
||||
def poll(self, context):
|
||||
sima = context.space_data
|
||||
settings = context.tool_settings.image_paint
|
||||
return sima.show_paint and settings.brush
|
||||
def poll(self, context):
|
||||
sima = context.space_data
|
||||
settings = context.tool_settings.image_paint
|
||||
return sima.show_paint and settings.brush
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
settings = context.tool_settings.image_paint
|
||||
brush = settings.brush
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
layout.itemR(brush, "use_airbrush")
|
||||
col = layout.column()
|
||||
col.active = brush.use_airbrush
|
||||
col.itemR(brush, "rate", slider=True)
|
||||
settings = context.tool_settings.image_paint
|
||||
brush = settings.brush
|
||||
|
||||
layout.itemR(brush, "use_space")
|
||||
row = layout.row(align=True)
|
||||
row.active = brush.use_space
|
||||
row.itemR(brush, "spacing", text="Distance", slider=True)
|
||||
row.itemR(brush, "use_spacing_pressure", toggle=True, text="")
|
||||
layout.itemR(brush, "use_airbrush")
|
||||
col = layout.column()
|
||||
col.active = brush.use_airbrush
|
||||
col.itemR(brush, "rate", slider=True)
|
||||
|
||||
layout.itemR(brush, "use_space")
|
||||
row = layout.row(align=True)
|
||||
row.active = brush.use_space
|
||||
row.itemR(brush, "spacing", text="Distance", slider=True)
|
||||
row.itemR(brush, "use_spacing_pressure", toggle=True, text="")
|
||||
|
||||
class IMAGE_PT_paint_curve(bpy.types.Panel):
|
||||
bl_space_type = 'IMAGE_EDITOR'
|
||||
bl_region_type = 'UI'
|
||||
bl_label = "Paint Curve"
|
||||
bl_default_closed = True
|
||||
bl_space_type = 'IMAGE_EDITOR'
|
||||
bl_region_type = 'UI'
|
||||
bl_label = "Paint Curve"
|
||||
bl_default_closed = True
|
||||
|
||||
def poll(self, context):
|
||||
sima = context.space_data
|
||||
settings = context.tool_settings.image_paint
|
||||
return sima.show_paint and settings.brush
|
||||
def poll(self, context):
|
||||
sima = context.space_data
|
||||
settings = context.tool_settings.image_paint
|
||||
return sima.show_paint and settings.brush
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
settings = context.tool_settings.image_paint
|
||||
brush = settings.brush
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
layout.template_curve_mapping(brush, "curve")
|
||||
layout.item_menu_enumO("brush.curve_preset", property="shape")
|
||||
settings = context.tool_settings.image_paint
|
||||
brush = settings.brush
|
||||
|
||||
layout.template_curve_mapping(brush, "curve")
|
||||
layout.item_menu_enumO("brush.curve_preset", property="shape")
|
||||
|
||||
bpy.types.register(IMAGE_MT_view)
|
||||
bpy.types.register(IMAGE_MT_select)
|
||||
|
@ -5,234 +5,234 @@ import dynamic_menu
|
||||
# reload(dynamic_menu)
|
||||
|
||||
class INFO_HT_header(bpy.types.Header):
|
||||
bl_space_type = 'INFO'
|
||||
bl_space_type = 'INFO'
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
st = context.space_data
|
||||
scene = context.scene
|
||||
rd = scene.render_data
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
row = layout.row(align=True)
|
||||
row.template_header()
|
||||
st = context.space_data
|
||||
scene = context.scene
|
||||
rd = scene.render_data
|
||||
|
||||
if context.area.show_menus:
|
||||
sub = row.row(align=True)
|
||||
sub.itemM("INFO_MT_file")
|
||||
sub.itemM("INFO_MT_add")
|
||||
if rd.use_game_engine:
|
||||
sub.itemM("INFO_MT_game")
|
||||
else:
|
||||
sub.itemM("INFO_MT_render")
|
||||
sub.itemM("INFO_MT_help")
|
||||
row = layout.row(align=True)
|
||||
row.template_header()
|
||||
|
||||
layout.template_ID(context.window, "screen", new="screen.new", unlink="screen.delete")
|
||||
layout.template_ID(context.screen, "scene", new="scene.new", unlink="scene.delete")
|
||||
if context.area.show_menus:
|
||||
sub = row.row(align=True)
|
||||
sub.itemM("INFO_MT_file")
|
||||
sub.itemM("INFO_MT_add")
|
||||
if rd.use_game_engine:
|
||||
sub.itemM("INFO_MT_game")
|
||||
else:
|
||||
sub.itemM("INFO_MT_render")
|
||||
sub.itemM("INFO_MT_help")
|
||||
|
||||
if rd.multiple_engines:
|
||||
layout.itemR(rd, "engine", text="")
|
||||
layout.template_ID(context.window, "screen", new="screen.new", unlink="screen.delete")
|
||||
layout.template_ID(context.screen, "scene", new="scene.new", unlink="scene.delete")
|
||||
|
||||
layout.itemS()
|
||||
if rd.multiple_engines:
|
||||
layout.itemR(rd, "engine", text="")
|
||||
|
||||
layout.template_operator_search()
|
||||
layout.template_running_jobs()
|
||||
layout.itemS()
|
||||
|
||||
layout.itemL(text=scene.statistics())
|
||||
|
||||
layout.itemO("wm.window_fullscreen_toggle", icon='ICON_ARROW_LEFTRIGHT', text="")
|
||||
layout.template_operator_search()
|
||||
layout.template_running_jobs()
|
||||
|
||||
layout.itemL(text=scene.statistics())
|
||||
|
||||
layout.itemO("wm.window_fullscreen_toggle", icon='ICON_ARROW_LEFTRIGHT', text="")
|
||||
|
||||
class INFO_MT_file(bpy.types.Menu):
|
||||
bl_label = "File"
|
||||
bl_label = "File"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
layout.operator_context = "EXEC_AREA"
|
||||
layout.itemO("wm.read_homefile", text="New", icon='ICON_NEW')
|
||||
layout.operator_context = "INVOKE_AREA"
|
||||
layout.itemO("wm.open_mainfile", text="Open...", icon='ICON_FILE_FOLDER')
|
||||
layout.item_menu_enumO("wm.open_recentfile", "file", text="Open Recent")
|
||||
layout.itemO("wm.recover_last_session")
|
||||
layout.itemO("wm.recover_auto_save", text="Recover Auto Save...")
|
||||
layout.operator_context = "EXEC_AREA"
|
||||
layout.itemO("wm.read_homefile", text="New", icon='ICON_NEW')
|
||||
layout.operator_context = "INVOKE_AREA"
|
||||
layout.itemO("wm.open_mainfile", text="Open...", icon='ICON_FILE_FOLDER')
|
||||
layout.item_menu_enumO("wm.open_recentfile", "file", text="Open Recent")
|
||||
layout.itemO("wm.recover_last_session")
|
||||
layout.itemO("wm.recover_auto_save", text="Recover Auto Save...")
|
||||
|
||||
layout.itemS()
|
||||
layout.itemS()
|
||||
|
||||
layout.operator_context = "EXEC_AREA"
|
||||
layout.itemO("wm.save_mainfile", text="Save", icon='ICON_FILE_TICK')
|
||||
layout.operator_context = "INVOKE_AREA"
|
||||
layout.itemO("wm.save_as_mainfile", text="Save As...")
|
||||
layout.itemO("screen.userpref_show", text="User Preferences...", icon='ICON_PREFERENCES')
|
||||
layout.operator_context = "EXEC_AREA"
|
||||
layout.itemO("wm.save_mainfile", text="Save", icon='ICON_FILE_TICK')
|
||||
layout.operator_context = "INVOKE_AREA"
|
||||
layout.itemO("wm.save_as_mainfile", text="Save As...")
|
||||
layout.itemO("screen.userpref_show", text="User Preferences...", icon='ICON_PREFERENCES')
|
||||
|
||||
layout.itemS()
|
||||
layout.operator_context = "INVOKE_AREA"
|
||||
layout.itemO("wm.link_append", text="Link")
|
||||
layout.item_booleanO("wm.link_append", "link", False, text="Append")
|
||||
layout.itemS()
|
||||
layout.itemS()
|
||||
layout.operator_context = "INVOKE_AREA"
|
||||
layout.itemO("wm.link_append", text="Link")
|
||||
layout.item_booleanO("wm.link_append", "link", False, text="Append")
|
||||
layout.itemS()
|
||||
|
||||
layout.itemM("INFO_MT_file_import")
|
||||
layout.itemM("INFO_MT_file_export")
|
||||
layout.itemM("INFO_MT_file_import")
|
||||
layout.itemM("INFO_MT_file_export")
|
||||
|
||||
layout.itemS()
|
||||
layout.itemS()
|
||||
|
||||
layout.itemM("INFO_MT_file_external_data")
|
||||
layout.itemM("INFO_MT_file_external_data")
|
||||
|
||||
layout.itemS()
|
||||
layout.itemS()
|
||||
|
||||
layout.operator_context = "EXEC_AREA"
|
||||
layout.itemO("wm.exit_blender", text="Quit", icon='ICON_QUIT')
|
||||
layout.operator_context = "EXEC_AREA"
|
||||
layout.itemO("wm.exit_blender", text="Quit", icon='ICON_QUIT')
|
||||
|
||||
# test for expanding menus
|
||||
'''
|
||||
class INFO_MT_file_more(INFO_MT_file):
|
||||
bl_label = "File"
|
||||
bl_label = "File"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
layout.itemO("wm.read_homefile", text="TESTING ")
|
||||
layout.itemO("wm.read_homefile", text="TESTING ")
|
||||
|
||||
dynamic_menu.setup(INFO_MT_file_more)
|
||||
'''
|
||||
|
||||
class INFO_MT_file_import(dynamic_menu.DynMenu):
|
||||
bl_idname = "INFO_MT_file_import"
|
||||
bl_label = "Import"
|
||||
bl_idname = "INFO_MT_file_import"
|
||||
bl_label = "Import"
|
||||
|
||||
def draw(self, context):
|
||||
self.layout.itemO("WM_OT_collada_import", text="COLLADA (.dae)...")
|
||||
def draw(self, context):
|
||||
self.layout.itemO("WM_OT_collada_import", text="COLLADA (.dae)...")
|
||||
|
||||
class INFO_MT_file_export(dynamic_menu.DynMenu):
|
||||
bl_idname = "INFO_MT_file_export"
|
||||
bl_label = "Export"
|
||||
bl_idname = "INFO_MT_file_export"
|
||||
bl_label = "Export"
|
||||
|
||||
def draw(self, context):
|
||||
self.layout.itemO("WM_OT_collada_export", text="COLLADA (.dae)...")
|
||||
def draw(self, context):
|
||||
self.layout.itemO("WM_OT_collada_export", text="COLLADA (.dae)...")
|
||||
|
||||
class INFO_MT_file_external_data(bpy.types.Menu):
|
||||
bl_label = "External Data"
|
||||
bl_label = "External Data"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
layout.itemO("file.pack_all", text="Pack into .blend file")
|
||||
layout.itemO("file.unpack_all", text="Unpack into Files...")
|
||||
layout.itemO("file.pack_all", text="Pack into .blend file")
|
||||
layout.itemO("file.unpack_all", text="Unpack into Files...")
|
||||
|
||||
layout.itemS()
|
||||
layout.itemS()
|
||||
|
||||
layout.itemO("file.make_paths_relative")
|
||||
layout.itemO("file.make_paths_absolute")
|
||||
layout.itemO("file.report_missing_files")
|
||||
layout.itemO("file.find_missing_files")
|
||||
layout.itemO("file.make_paths_relative")
|
||||
layout.itemO("file.make_paths_absolute")
|
||||
layout.itemO("file.report_missing_files")
|
||||
layout.itemO("file.find_missing_files")
|
||||
|
||||
class INFO_MT_mesh_add(dynamic_menu.DynMenu):
|
||||
bl_idname = "INFO_MT_mesh_add"
|
||||
bl_label = "Mesh"
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.operator_context = 'INVOKE_REGION_WIN'
|
||||
layout.itemO("mesh.primitive_plane_add", icon='ICON_MESH_PLANE', text="Plane")
|
||||
layout.itemO("mesh.primitive_cube_add", icon='ICON_MESH_CUBE', text="Cube")
|
||||
layout.itemO("mesh.primitive_circle_add", icon='ICON_MESH_CIRCLE', text="Circle")
|
||||
layout.itemO("mesh.primitive_uv_sphere_add", icon='ICON_MESH_UVSPHERE', text="UV Sphere")
|
||||
layout.itemO("mesh.primitive_ico_sphere_add", icon='ICON_MESH_ICOSPHERE', text="Icosphere")
|
||||
layout.itemO("mesh.primitive_tube_add", icon='ICON_MESH_TUBE', text="Tube")
|
||||
layout.itemO("mesh.primitive_cone_add", icon='ICON_MESH_CONE', text="Cone")
|
||||
layout.itemS()
|
||||
layout.itemO("mesh.primitive_grid_add", icon='ICON_MESH_GRID', text="Grid")
|
||||
layout.itemO("mesh.primitive_monkey_add", icon='ICON_MESH_MONKEY', text="Monkey")
|
||||
bl_idname = "INFO_MT_mesh_add"
|
||||
bl_label = "Mesh"
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.operator_context = 'INVOKE_REGION_WIN'
|
||||
layout.itemO("mesh.primitive_plane_add", icon='ICON_MESH_PLANE', text="Plane")
|
||||
layout.itemO("mesh.primitive_cube_add", icon='ICON_MESH_CUBE', text="Cube")
|
||||
layout.itemO("mesh.primitive_circle_add", icon='ICON_MESH_CIRCLE', text="Circle")
|
||||
layout.itemO("mesh.primitive_uv_sphere_add", icon='ICON_MESH_UVSPHERE', text="UV Sphere")
|
||||
layout.itemO("mesh.primitive_ico_sphere_add", icon='ICON_MESH_ICOSPHERE', text="Icosphere")
|
||||
layout.itemO("mesh.primitive_tube_add", icon='ICON_MESH_TUBE', text="Tube")
|
||||
layout.itemO("mesh.primitive_cone_add", icon='ICON_MESH_CONE', text="Cone")
|
||||
layout.itemS()
|
||||
layout.itemO("mesh.primitive_grid_add", icon='ICON_MESH_GRID', text="Grid")
|
||||
layout.itemO("mesh.primitive_monkey_add", icon='ICON_MESH_MONKEY', text="Monkey")
|
||||
|
||||
class INFO_MT_add(bpy.types.Menu):
|
||||
bl_label = "Add"
|
||||
bl_label = "Add"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
layout.operator_context = "EXEC_SCREEN"
|
||||
layout.operator_context = "EXEC_SCREEN"
|
||||
|
||||
# layout.item_menu_enumO("object.mesh_add", "type", text="Mesh", icon='ICON_OUTLINER_OB_MESH')
|
||||
layout.itemM("INFO_MT_mesh_add", icon='ICON_OUTLINER_OB_MESH')
|
||||
|
||||
layout.item_menu_enumO("object.curve_add", "type", text="Curve", icon='ICON_OUTLINER_OB_CURVE')
|
||||
layout.item_menu_enumO("object.surface_add", "type", text="Surface", icon='ICON_OUTLINER_OB_SURFACE')
|
||||
layout.item_menu_enumO("object.metaball_add", "type", 'META', text="Metaball", icon='ICON_OUTLINER_OB_META')
|
||||
layout.itemO("object.text_add", text="Text", icon='ICON_OUTLINER_OB_FONT')
|
||||
# layout.item_menu_enumO("object.mesh_add", "type", text="Mesh", icon='ICON_OUTLINER_OB_MESH')
|
||||
layout.itemM("INFO_MT_mesh_add", icon='ICON_OUTLINER_OB_MESH')
|
||||
|
||||
layout.itemS()
|
||||
layout.item_menu_enumO("object.curve_add", "type", text="Curve", icon='ICON_OUTLINER_OB_CURVE')
|
||||
layout.item_menu_enumO("object.surface_add", "type", text="Surface", icon='ICON_OUTLINER_OB_SURFACE')
|
||||
layout.item_menu_enumO("object.metaball_add", "type", 'META', text="Metaball", icon='ICON_OUTLINER_OB_META')
|
||||
layout.itemO("object.text_add", text="Text", icon='ICON_OUTLINER_OB_FONT')
|
||||
|
||||
layout.itemO("object.armature_add", text="Armature", icon='ICON_OUTLINER_OB_ARMATURE')
|
||||
layout.item_enumO("object.add", "type", 'LATTICE', icon='ICON_OUTLINER_OB_LATTICE')
|
||||
layout.item_enumO("object.add", "type", 'EMPTY', icon='ICON_OUTLINER_OB_EMPTY')
|
||||
layout.itemS()
|
||||
|
||||
layout.itemS()
|
||||
layout.itemO("object.armature_add", text="Armature", icon='ICON_OUTLINER_OB_ARMATURE')
|
||||
layout.item_enumO("object.add", "type", 'LATTICE', icon='ICON_OUTLINER_OB_LATTICE')
|
||||
layout.item_enumO("object.add", "type", 'EMPTY', icon='ICON_OUTLINER_OB_EMPTY')
|
||||
|
||||
layout.item_enumO("object.add", "type", 'CAMERA', icon='ICON_OUTLINER_OB_CAMERA')
|
||||
layout.item_menu_enumO("object.lamp_add", "type", 'LAMP', text="Lamp", icon='ICON_OUTLINER_OB_LAMP')
|
||||
|
||||
layout.itemS()
|
||||
|
||||
layout.item_menu_enumO("object.effector_add", "type", 'EMPTY', text="Force Field", icon='ICON_OUTLINER_OB_EMPTY')
|
||||
layout.itemS()
|
||||
|
||||
layout.itemS()
|
||||
|
||||
layout.item_menu_enumO("object.group_instance_add", "type", text="Group Instance", icon='ICON_OUTLINER_OB_EMPTY')
|
||||
layout.item_enumO("object.add", "type", 'CAMERA', icon='ICON_OUTLINER_OB_CAMERA')
|
||||
layout.item_menu_enumO("object.lamp_add", "type", 'LAMP', text="Lamp", icon='ICON_OUTLINER_OB_LAMP')
|
||||
|
||||
layout.itemS()
|
||||
|
||||
layout.item_menu_enumO("object.effector_add", "type", 'EMPTY', text="Force Field", icon='ICON_OUTLINER_OB_EMPTY')
|
||||
|
||||
layout.itemS()
|
||||
|
||||
layout.item_menu_enumO("object.group_instance_add", "type", text="Group Instance", icon='ICON_OUTLINER_OB_EMPTY')
|
||||
|
||||
class INFO_MT_game(bpy.types.Menu):
|
||||
bl_label = "Game"
|
||||
bl_label = "Game"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
gs = context.scene.game_data
|
||||
gs = context.scene.game_data
|
||||
|
||||
layout.itemO("view3d.game_start")
|
||||
layout.itemO("view3d.game_start")
|
||||
|
||||
layout.itemS()
|
||||
layout.itemS()
|
||||
|
||||
layout.itemR(gs, "show_debug_properties")
|
||||
layout.itemR(gs, "show_framerate_profile")
|
||||
layout.itemR(gs, "show_physics_visualization")
|
||||
layout.itemR(gs, "deprecation_warnings")
|
||||
layout.itemR(gs, "show_debug_properties")
|
||||
layout.itemR(gs, "show_framerate_profile")
|
||||
layout.itemR(gs, "show_physics_visualization")
|
||||
layout.itemR(gs, "deprecation_warnings")
|
||||
|
||||
class INFO_MT_render(bpy.types.Menu):
|
||||
bl_label = "Render"
|
||||
bl_label = "Render"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
rd = context.scene.render_data
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
layout.itemO("screen.render", text="Render Image", icon='ICON_RENDER_STILL')
|
||||
layout.item_booleanO("screen.render", "animation", True, text="Render Animation", icon='ICON_RENDER_ANIMATION')
|
||||
rd = context.scene.render_data
|
||||
|
||||
layout.itemS()
|
||||
layout.itemO("screen.render", text="Render Image", icon='ICON_RENDER_STILL')
|
||||
layout.item_booleanO("screen.render", "animation", True, text="Render Animation", icon='ICON_RENDER_ANIMATION')
|
||||
|
||||
layout.itemO("screen.opengl_render", text="OpenGL Render Image")
|
||||
layout.item_booleanO("screen.opengl_render", "animation", True, text="OpenGL Render Animation")
|
||||
layout.itemS()
|
||||
|
||||
layout.itemS()
|
||||
layout.itemO("screen.opengl_render", text="OpenGL Render Image")
|
||||
layout.item_booleanO("screen.opengl_render", "animation", True, text="OpenGL Render Animation")
|
||||
|
||||
layout.itemO("screen.render_view_show")
|
||||
layout.itemS()
|
||||
|
||||
layout.itemO("screen.render_view_show")
|
||||
|
||||
class INFO_MT_help(bpy.types.Menu):
|
||||
bl_label = "Help"
|
||||
bl_label = "Help"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
layout.itemO("help.manual", icon='ICON_HELP')
|
||||
layout.itemO("help.release_logs", icon='ICON_URL')
|
||||
layout.itemO("help.manual", icon='ICON_HELP')
|
||||
layout.itemO("help.release_logs", icon='ICON_URL')
|
||||
|
||||
layout.itemS()
|
||||
layout.itemS()
|
||||
|
||||
layout.itemO("help.blender_website", icon='ICON_URL')
|
||||
layout.itemO("help.blender_eshop", icon='ICON_URL')
|
||||
layout.itemO("help.developer_community", icon='ICON_URL')
|
||||
layout.itemO("help.user_community", icon='ICON_URL')
|
||||
layout.itemS()
|
||||
layout.itemO("help.report_bug", icon='ICON_URL')
|
||||
layout.itemS()
|
||||
layout.itemO("help.operator_cheat_sheet")
|
||||
layout.itemO("help.blender_website", icon='ICON_URL')
|
||||
layout.itemO("help.blender_eshop", icon='ICON_URL')
|
||||
layout.itemO("help.developer_community", icon='ICON_URL')
|
||||
layout.itemO("help.user_community", icon='ICON_URL')
|
||||
layout.itemS()
|
||||
layout.itemO("help.report_bug", icon='ICON_URL')
|
||||
layout.itemS()
|
||||
layout.itemO("help.operator_cheat_sheet")
|
||||
|
||||
bpy.types.register(INFO_HT_header)
|
||||
bpy.types.register(INFO_MT_file)
|
||||
@ -248,77 +248,77 @@ bpy.types.register(INFO_MT_help)
|
||||
# Help operators
|
||||
|
||||
class HelpOperator(bpy.types.Operator):
|
||||
def execute(self, context):
|
||||
import webbrowser
|
||||
webbrowser.open(self._url)
|
||||
return ('FINISHED',)
|
||||
def execute(self, context):
|
||||
import webbrowser
|
||||
webbrowser.open(self._url)
|
||||
return ('FINISHED',)
|
||||
|
||||
class HELP_OT_manual(HelpOperator):
|
||||
'''The Blender Wiki manual'''
|
||||
bl_idname = "help.manual"
|
||||
bl_label = "Manual"
|
||||
_url = 'http://wiki.blender.org/index.php/Manual'
|
||||
'''The Blender Wiki manual'''
|
||||
bl_idname = "help.manual"
|
||||
bl_label = "Manual"
|
||||
_url = 'http://wiki.blender.org/index.php/Manual'
|
||||
|
||||
class HELP_OT_release_logs(HelpOperator):
|
||||
'''Information about the changes in this version of Blender'''
|
||||
bl_idname = "help.release_logs"
|
||||
bl_label = "Release Logs"
|
||||
_url = 'http://www.blender.org/development/release-logs/'
|
||||
'''Information about the changes in this version of Blender'''
|
||||
bl_idname = "help.release_logs"
|
||||
bl_label = "Release Logs"
|
||||
_url = 'http://www.blender.org/development/release-logs/'
|
||||
|
||||
class HELP_OT_blender_website(HelpOperator):
|
||||
'''The official Blender website'''
|
||||
bl_idname = "help.blender_website"
|
||||
bl_label = "Blender Website"
|
||||
_url = 'http://www.blender.org/'
|
||||
'''The official Blender website'''
|
||||
bl_idname = "help.blender_website"
|
||||
bl_label = "Blender Website"
|
||||
_url = 'http://www.blender.org/'
|
||||
|
||||
class HELP_OT_blender_eshop(HelpOperator):
|
||||
'''Buy official Blender resources and merchandise online'''
|
||||
bl_idname = "help.blender_eshop"
|
||||
bl_label = "Blender e-Shop"
|
||||
_url = 'http://www.blender3d.org/e-shop'
|
||||
'''Buy official Blender resources and merchandise online'''
|
||||
bl_idname = "help.blender_eshop"
|
||||
bl_label = "Blender e-Shop"
|
||||
_url = 'http://www.blender3d.org/e-shop'
|
||||
|
||||
class HELP_OT_developer_community(HelpOperator):
|
||||
'''Get involved with Blender development'''
|
||||
bl_idname = "help.developer_community"
|
||||
bl_label = "Developer Community"
|
||||
_url = 'http://www.blender.org/community/get-involved/'
|
||||
'''Get involved with Blender development'''
|
||||
bl_idname = "help.developer_community"
|
||||
bl_label = "Developer Community"
|
||||
_url = 'http://www.blender.org/community/get-involved/'
|
||||
|
||||
class HELP_OT_user_community(HelpOperator):
|
||||
'''Get involved with other Blender users'''
|
||||
bl_idname = "help.user_community"
|
||||
bl_label = "User Community"
|
||||
_url = 'http://www.blender.org/community/user-community/'
|
||||
|
||||
'''Get involved with other Blender users'''
|
||||
bl_idname = "help.user_community"
|
||||
bl_label = "User Community"
|
||||
_url = 'http://www.blender.org/community/user-community/'
|
||||
|
||||
class HELP_OT_report_bug(HelpOperator):
|
||||
'''Report a bug in the Blender bug tracker'''
|
||||
bl_idname = "help.report_bug"
|
||||
bl_label = "Report a Bug"
|
||||
_url = 'http://projects.blender.org/tracker/?atid=498&group_id=9&func=browse'
|
||||
'''Report a bug in the Blender bug tracker'''
|
||||
bl_idname = "help.report_bug"
|
||||
bl_label = "Report a Bug"
|
||||
_url = 'http://projects.blender.org/tracker/?atid=498&group_id=9&func=browse'
|
||||
|
||||
class HELP_OT_operator_cheat_sheet(bpy.types.Operator):
|
||||
bl_idname = "help.operator_cheat_sheet"
|
||||
bl_label = "Operator Cheat Sheet (new textblock)"
|
||||
def execute(self, context):
|
||||
op_strings = []
|
||||
tot = 0
|
||||
for op_module_name in dir(bpy.ops):
|
||||
op_module = getattr(bpy.ops, op_module_name)
|
||||
for op_submodule_name in dir(op_module):
|
||||
op = getattr(op_module, op_submodule_name)
|
||||
text = repr(op)
|
||||
if text.startswith('bpy.ops.'):
|
||||
op_strings.append(text)
|
||||
tot += 1
|
||||
|
||||
op_strings.append('')
|
||||
|
||||
bpy.ops.text.new() # XXX - assumes new text is always at the end!
|
||||
textblock = bpy.data.texts[-1]
|
||||
textblock.write('# %d Operators\n\n' % tot)
|
||||
textblock.write('\n'.join(op_strings))
|
||||
textblock.name = "OperatorList.txt"
|
||||
print("See OperatorList.txt textblock")
|
||||
return ('FINISHED',)
|
||||
bl_idname = "help.operator_cheat_sheet"
|
||||
bl_label = "Operator Cheat Sheet (new textblock)"
|
||||
def execute(self, context):
|
||||
op_strings = []
|
||||
tot = 0
|
||||
for op_module_name in dir(bpy.ops):
|
||||
op_module = getattr(bpy.ops, op_module_name)
|
||||
for op_submodule_name in dir(op_module):
|
||||
op = getattr(op_module, op_submodule_name)
|
||||
text = repr(op)
|
||||
if text.startswith('bpy.ops.'):
|
||||
op_strings.append(text)
|
||||
tot += 1
|
||||
|
||||
op_strings.append('')
|
||||
|
||||
bpy.ops.text.new() # XXX - assumes new text is always at the end!
|
||||
textblock = bpy.data.texts[-1]
|
||||
textblock.write('# %d Operators\n\n' % tot)
|
||||
textblock.write('\n'.join(op_strings))
|
||||
textblock.name = "OperatorList.txt"
|
||||
print("See OperatorList.txt textblock")
|
||||
return ('FINISHED',)
|
||||
|
||||
bpy.ops.add(HELP_OT_manual)
|
||||
bpy.ops.add(HELP_OT_release_logs)
|
||||
|
@ -1,29 +1,29 @@
|
||||
import bpy
|
||||
|
||||
class LOGIC_PT_properties(bpy.types.Panel):
|
||||
bl_space_type = 'LOGIC_EDITOR'
|
||||
bl_region_type = 'UI'
|
||||
bl_label = "Properties"
|
||||
bl_space_type = 'LOGIC_EDITOR'
|
||||
bl_region_type = 'UI'
|
||||
bl_label = "Properties"
|
||||
|
||||
def poll(self, context):
|
||||
ob = context.active_object
|
||||
return ob and ob.game
|
||||
def poll(self, context):
|
||||
ob = context.active_object
|
||||
return ob and ob.game
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
ob = context.active_object
|
||||
game = ob.game
|
||||
|
||||
layout.itemO("object.game_property_new", text="Add Game Property")
|
||||
|
||||
for i, prop in enumerate(game.properties):
|
||||
|
||||
row = layout.row(align=True)
|
||||
row.itemR(prop, "name", text="")
|
||||
row.itemR(prop, "type", text="")
|
||||
row.itemR(prop, "value", text="", toggle=True) # we dont care about the type. rna will display correctly
|
||||
row.itemR(prop, "debug", text="", toggle=True, icon='ICON_INFO')
|
||||
row.item_intO("object.game_property_remove", "index", i, text="", icon='ICON_X')
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
ob = context.active_object
|
||||
game = ob.game
|
||||
|
||||
layout.itemO("object.game_property_new", text="Add Game Property")
|
||||
|
||||
for i, prop in enumerate(game.properties):
|
||||
|
||||
row = layout.row(align=True)
|
||||
row.itemR(prop, "name", text="")
|
||||
row.itemR(prop, "type", text="")
|
||||
row.itemR(prop, "value", text="", toggle=True) # we dont care about the type. rna will display correctly
|
||||
row.itemR(prop, "debug", text="", toggle=True, icon='ICON_INFO')
|
||||
row.item_intO("object.game_property_remove", "index", i, text="", icon='ICON_X')
|
||||
|
||||
bpy.types.register(LOGIC_PT_properties)
|
||||
|
@ -2,112 +2,112 @@
|
||||
import bpy
|
||||
|
||||
class NODE_HT_header(bpy.types.Header):
|
||||
bl_space_type = 'NODE_EDITOR'
|
||||
bl_space_type = 'NODE_EDITOR'
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
snode = context.space_data
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
row = layout.row(align=True)
|
||||
row.template_header()
|
||||
snode = context.space_data
|
||||
|
||||
if context.area.show_menus:
|
||||
sub = row.row(align=True)
|
||||
sub.itemM("NODE_MT_view")
|
||||
sub.itemM("NODE_MT_select")
|
||||
sub.itemM("NODE_MT_add")
|
||||
sub.itemM("NODE_MT_node")
|
||||
row = layout.row(align=True)
|
||||
row.template_header()
|
||||
|
||||
row = layout.row()
|
||||
row.itemR(snode, "tree_type", text="", expand=True)
|
||||
if context.area.show_menus:
|
||||
sub = row.row(align=True)
|
||||
sub.itemM("NODE_MT_view")
|
||||
sub.itemM("NODE_MT_select")
|
||||
sub.itemM("NODE_MT_add")
|
||||
sub.itemM("NODE_MT_node")
|
||||
|
||||
if snode.tree_type == 'MATERIAL':
|
||||
ob = snode.id_from
|
||||
id = snode.id
|
||||
if ob:
|
||||
layout.template_ID(ob, "active_material", new="material.new")
|
||||
if id:
|
||||
layout.itemR(id, "use_nodes")
|
||||
row = layout.row()
|
||||
row.itemR(snode, "tree_type", text="", expand=True)
|
||||
|
||||
elif snode.tree_type == 'TEXTURE':
|
||||
row.itemR(snode, "texture_type", text="", expand=True)
|
||||
if snode.tree_type == 'MATERIAL':
|
||||
ob = snode.id_from
|
||||
id = snode.id
|
||||
if ob:
|
||||
layout.template_ID(ob, "active_material", new="material.new")
|
||||
if id:
|
||||
layout.itemR(id, "use_nodes")
|
||||
|
||||
id = snode.id
|
||||
id_from = snode.id_from
|
||||
if id_from:
|
||||
layout.template_ID(id_from, "active_texture", new="texture.new")
|
||||
if id:
|
||||
layout.itemR(id, "use_nodes")
|
||||
elif snode.tree_type == 'TEXTURE':
|
||||
row.itemR(snode, "texture_type", text="", expand=True)
|
||||
|
||||
elif snode.tree_type == 'COMPOSITING':
|
||||
id = snode.id
|
||||
id = snode.id
|
||||
id_from = snode.id_from
|
||||
if id_from:
|
||||
layout.template_ID(id_from, "active_texture", new="texture.new")
|
||||
if id:
|
||||
layout.itemR(id, "use_nodes")
|
||||
|
||||
layout.itemR(id, "use_nodes")
|
||||
layout.itemR(id.render_data, "free_unused_nodes", text="Free Unused")
|
||||
layout.itemR(snode, "backdrop")
|
||||
elif snode.tree_type == 'COMPOSITING':
|
||||
id = snode.id
|
||||
|
||||
layout.itemR(id, "use_nodes")
|
||||
layout.itemR(id.render_data, "free_unused_nodes", text="Free Unused")
|
||||
layout.itemR(snode, "backdrop")
|
||||
|
||||
class NODE_MT_view(bpy.types.Menu):
|
||||
bl_label = "View"
|
||||
bl_label = "View"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
# layout.itemO("grease_pencil..")
|
||||
# layout.itemS()
|
||||
# layout.itemO("grease_pencil..")
|
||||
# layout.itemS()
|
||||
|
||||
layout.itemO("view2d.zoom_in")
|
||||
layout.itemO("view2d.zoom_out")
|
||||
layout.itemO("view2d.zoom_in")
|
||||
layout.itemO("view2d.zoom_out")
|
||||
|
||||
layout.itemS()
|
||||
layout.itemS()
|
||||
|
||||
layout.itemO("node.view_all")
|
||||
layout.itemO("screen.screen_full_area")
|
||||
layout.itemO("node.view_all")
|
||||
layout.itemO("screen.screen_full_area")
|
||||
|
||||
class NODE_MT_select(bpy.types.Menu):
|
||||
bl_label = "Select"
|
||||
bl_label = "Select"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
layout.itemO("node.select_border")
|
||||
layout.itemO("node.select_border")
|
||||
|
||||
layout.itemS()
|
||||
layout.itemO("node.select_all")
|
||||
layout.itemO("node.select_linked_from")
|
||||
layout.itemO("node.select_linked_to")
|
||||
layout.itemS()
|
||||
layout.itemO("node.select_all")
|
||||
layout.itemO("node.select_linked_from")
|
||||
layout.itemO("node.select_linked_to")
|
||||
|
||||
class NODE_MT_node(bpy.types.Menu):
|
||||
bl_label = "Node"
|
||||
bl_label = "Node"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
layout.itemO("tfm.translate")
|
||||
layout.itemO("tfm.resize")
|
||||
layout.itemO("tfm.rotate")
|
||||
layout.itemO("tfm.translate")
|
||||
layout.itemO("tfm.resize")
|
||||
layout.itemO("tfm.rotate")
|
||||
|
||||
layout.itemS()
|
||||
layout.itemS()
|
||||
|
||||
layout.itemO("node.duplicate")
|
||||
layout.itemO("node.delete")
|
||||
layout.itemO("node.duplicate")
|
||||
layout.itemO("node.delete")
|
||||
|
||||
# XXX
|
||||
# layout.itemS()
|
||||
# layout.itemO("node.make_link")
|
||||
layout.itemS()
|
||||
layout.itemO("node.group_edit")
|
||||
layout.itemO("node.group_ungroup")
|
||||
layout.itemO("node.group_make")
|
||||
# XXX
|
||||
# layout.itemS()
|
||||
# layout.itemO("node.make_link")
|
||||
layout.itemS()
|
||||
layout.itemO("node.group_edit")
|
||||
layout.itemO("node.group_ungroup")
|
||||
layout.itemO("node.group_make")
|
||||
|
||||
layout.itemS()
|
||||
layout.itemS()
|
||||
|
||||
layout.itemO("node.visibility_toggle")
|
||||
layout.itemO("node.visibility_toggle")
|
||||
|
||||
# XXX
|
||||
# layout.itemO("node.rename")
|
||||
# layout.itemS()
|
||||
# layout.itemO("node.show_cyclic_dependencies")
|
||||
# XXX
|
||||
# layout.itemO("node.rename")
|
||||
# layout.itemS()
|
||||
# layout.itemO("node.show_cyclic_dependencies")
|
||||
|
||||
bpy.types.register(NODE_HT_header)
|
||||
bpy.types.register(NODE_MT_view)
|
||||
|
@ -2,76 +2,76 @@
|
||||
import bpy
|
||||
|
||||
class OUTLINER_HT_header(bpy.types.Header):
|
||||
bl_space_type = 'OUTLINER'
|
||||
bl_space_type = 'OUTLINER'
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
space = context.space_data
|
||||
scene = context.scene
|
||||
ks = context.scene.active_keying_set
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
row = layout.row(align=True)
|
||||
row.template_header()
|
||||
space = context.space_data
|
||||
scene = context.scene
|
||||
ks = context.scene.active_keying_set
|
||||
|
||||
if context.area.show_menus:
|
||||
sub = row.row(align=True)
|
||||
sub.itemM("OUTLINER_MT_view")
|
||||
if space.display_mode == 'DATABLOCKS':
|
||||
sub.itemM("OUTLINER_MT_edit_datablocks")
|
||||
row = layout.row(align=True)
|
||||
row.template_header()
|
||||
|
||||
layout.itemR(space, "display_mode", text="")
|
||||
|
||||
layout.itemS()
|
||||
|
||||
if space.display_mode == 'DATABLOCKS':
|
||||
row = layout.row(align=True)
|
||||
row.itemO("outliner.keyingset_add_selected", icon='ICON_ZOOMIN', text="")
|
||||
row.itemO("outliner.keyingset_remove_selected", icon='ICON_ZOOMOUT', text="")
|
||||
|
||||
if ks:
|
||||
row = layout.row(align=False)
|
||||
row.item_pointerR(scene, "active_keying_set", scene, "keying_sets", text="")
|
||||
|
||||
row = layout.row(align=True)
|
||||
row.itemO("anim.insert_keyframe", text="", icon='ICON_KEY_HLT')
|
||||
row.itemO("anim.delete_keyframe", text="", icon='ICON_KEY_DEHLT')
|
||||
else:
|
||||
row = layout.row(align=False)
|
||||
row.itemL(text="No Keying Set active")
|
||||
if context.area.show_menus:
|
||||
sub = row.row(align=True)
|
||||
sub.itemM("OUTLINER_MT_view")
|
||||
if space.display_mode == 'DATABLOCKS':
|
||||
sub.itemM("OUTLINER_MT_edit_datablocks")
|
||||
|
||||
layout.itemR(space, "display_mode", text="")
|
||||
|
||||
layout.itemS()
|
||||
|
||||
if space.display_mode == 'DATABLOCKS':
|
||||
row = layout.row(align=True)
|
||||
row.itemO("outliner.keyingset_add_selected", icon='ICON_ZOOMIN', text="")
|
||||
row.itemO("outliner.keyingset_remove_selected", icon='ICON_ZOOMOUT', text="")
|
||||
|
||||
if ks:
|
||||
row = layout.row(align=False)
|
||||
row.item_pointerR(scene, "active_keying_set", scene, "keying_sets", text="")
|
||||
|
||||
row = layout.row(align=True)
|
||||
row.itemO("anim.insert_keyframe", text="", icon='ICON_KEY_HLT')
|
||||
row.itemO("anim.delete_keyframe", text="", icon='ICON_KEY_DEHLT')
|
||||
else:
|
||||
row = layout.row(align=False)
|
||||
row.itemL(text="No Keying Set active")
|
||||
|
||||
class OUTLINER_MT_view(bpy.types.Menu):
|
||||
bl_label = "View"
|
||||
bl_label = "View"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
space = context.space_data
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
col = layout.column()
|
||||
if space.display_mode not in ('DATABLOCKS', 'USER_PREFERENCES', 'KEYMAPS'):
|
||||
col.itemR(space, "show_restriction_columns")
|
||||
col.itemS()
|
||||
col.itemO("outliner.show_active")
|
||||
space = context.space_data
|
||||
|
||||
col = layout.column()
|
||||
if space.display_mode not in ('DATABLOCKS', 'USER_PREFERENCES', 'KEYMAPS'):
|
||||
col.itemR(space, "show_restriction_columns")
|
||||
col.itemS()
|
||||
col.itemO("outliner.show_active")
|
||||
|
||||
col.itemO("outliner.show_one_level")
|
||||
col.itemO("outliner.show_hierarchy")
|
||||
|
||||
col.itemO("outliner.show_one_level")
|
||||
col.itemO("outliner.show_hierarchy")
|
||||
|
||||
class OUTLINER_MT_edit_datablocks(bpy.types.Menu):
|
||||
bl_label = "Edit"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
col = layout.column()
|
||||
bl_label = "Edit"
|
||||
|
||||
col.itemO("outliner.keyingset_add_selected")
|
||||
col.itemO("outliner.keyingset_remove_selected")
|
||||
|
||||
col.itemS()
|
||||
|
||||
col.itemO("outliner.drivers_add_selected")
|
||||
col.itemO("outliner.drivers_delete_selected")
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
col = layout.column()
|
||||
|
||||
col.itemO("outliner.keyingset_add_selected")
|
||||
col.itemO("outliner.keyingset_remove_selected")
|
||||
|
||||
col.itemS()
|
||||
|
||||
col.itemO("outliner.drivers_add_selected")
|
||||
col.itemO("outliner.drivers_delete_selected")
|
||||
|
||||
bpy.types.register(OUTLINER_HT_header)
|
||||
bpy.types.register(OUTLINER_MT_view)
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -2,265 +2,265 @@
|
||||
import bpy
|
||||
|
||||
class TEXT_HT_header(bpy.types.Header):
|
||||
bl_space_type = 'TEXT_EDITOR'
|
||||
bl_space_type = 'TEXT_EDITOR'
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
st = context.space_data
|
||||
text = st.text
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
row = layout.row(align=True)
|
||||
row.template_header()
|
||||
st = context.space_data
|
||||
text = st.text
|
||||
|
||||
if context.area.show_menus:
|
||||
sub = row.row(align=True)
|
||||
sub.itemM("TEXT_MT_text")
|
||||
if text:
|
||||
sub.itemM("TEXT_MT_edit")
|
||||
sub.itemM("TEXT_MT_format")
|
||||
row = layout.row(align=True)
|
||||
row.template_header()
|
||||
|
||||
if text and text.modified:
|
||||
row = layout.row()
|
||||
# row.color(redalert)
|
||||
row.itemO("text.resolve_conflict", text="", icon='ICON_HELP')
|
||||
if context.area.show_menus:
|
||||
sub = row.row(align=True)
|
||||
sub.itemM("TEXT_MT_text")
|
||||
if text:
|
||||
sub.itemM("TEXT_MT_edit")
|
||||
sub.itemM("TEXT_MT_format")
|
||||
|
||||
layout.template_ID(st, "text", new="text.new", unlink="text.unlink")
|
||||
if text and text.modified:
|
||||
row = layout.row()
|
||||
# row.color(redalert)
|
||||
row.itemO("text.resolve_conflict", text="", icon='ICON_HELP')
|
||||
|
||||
row = layout.row(align=True)
|
||||
row.itemR(st, "line_numbers", text="")
|
||||
row.itemR(st, "word_wrap", text="")
|
||||
row.itemR(st, "syntax_highlight", text="")
|
||||
layout.template_ID(st, "text", new="text.new", unlink="text.unlink")
|
||||
|
||||
if text:
|
||||
row = layout.row()
|
||||
if text.filename != "":
|
||||
if text.dirty:
|
||||
row.itemL(text="File: *%s (unsaved)" % text.filename)
|
||||
else:
|
||||
row.itemL(text="File: %s" % text.filename )
|
||||
else:
|
||||
if text.library:
|
||||
row.itemL(text="Text: External")
|
||||
else:
|
||||
row.itemL(text="Text: Internal")
|
||||
|
||||
row = layout.row()
|
||||
row.itemO("text.run_script")
|
||||
row = layout.row(align=True)
|
||||
row.itemR(st, "line_numbers", text="")
|
||||
row.itemR(st, "word_wrap", text="")
|
||||
row.itemR(st, "syntax_highlight", text="")
|
||||
|
||||
if text:
|
||||
row = layout.row()
|
||||
if text.filename != "":
|
||||
if text.dirty:
|
||||
row.itemL(text="File: *%s (unsaved)" % text.filename)
|
||||
else:
|
||||
row.itemL(text="File: %s" % text.filename )
|
||||
else:
|
||||
if text.library:
|
||||
row.itemL(text="Text: External")
|
||||
else:
|
||||
row.itemL(text="Text: Internal")
|
||||
|
||||
row = layout.row()
|
||||
row.itemO("text.run_script")
|
||||
|
||||
class TEXT_PT_properties(bpy.types.Panel):
|
||||
bl_space_type = 'TEXT_EDITOR'
|
||||
bl_region_type = 'UI'
|
||||
bl_label = "Properties"
|
||||
bl_space_type = 'TEXT_EDITOR'
|
||||
bl_region_type = 'UI'
|
||||
bl_label = "Properties"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
st = context.space_data
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
flow = layout.column_flow()
|
||||
flow.itemR(st, "line_numbers")
|
||||
flow.itemR(st, "word_wrap")
|
||||
flow.itemR(st, "syntax_highlight")
|
||||
flow.itemR(st, "live_edit")
|
||||
st = context.space_data
|
||||
|
||||
flow = layout.column_flow()
|
||||
flow.itemR(st, "font_size")
|
||||
flow.itemR(st, "tab_width")
|
||||
flow = layout.column_flow()
|
||||
flow.itemR(st, "line_numbers")
|
||||
flow.itemR(st, "word_wrap")
|
||||
flow.itemR(st, "syntax_highlight")
|
||||
flow.itemR(st, "live_edit")
|
||||
|
||||
flow = layout.column_flow()
|
||||
flow.itemR(st, "font_size")
|
||||
flow.itemR(st, "tab_width")
|
||||
|
||||
class TEXT_PT_find(bpy.types.Panel):
|
||||
bl_space_type = 'TEXT_EDITOR'
|
||||
bl_region_type = 'UI'
|
||||
bl_label = "Find"
|
||||
bl_space_type = 'TEXT_EDITOR'
|
||||
bl_region_type = 'UI'
|
||||
bl_label = "Find"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
st = context.space_data
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
# find
|
||||
col = layout.column(align=True)
|
||||
row = col.row()
|
||||
row.itemR(st, "find_text", text="")
|
||||
row.itemO("text.find_set_selected", text="", icon='ICON_TEXT')
|
||||
col.itemO("text.find")
|
||||
st = context.space_data
|
||||
|
||||
# replace
|
||||
col = layout.column(align=True)
|
||||
row = col.row()
|
||||
row.itemR(st, "replace_text", text="")
|
||||
row.itemO("text.replace_set_selected", text="", icon='ICON_TEXT')
|
||||
col.itemO("text.replace")
|
||||
# find
|
||||
col = layout.column(align=True)
|
||||
row = col.row()
|
||||
row.itemR(st, "find_text", text="")
|
||||
row.itemO("text.find_set_selected", text="", icon='ICON_TEXT')
|
||||
col.itemO("text.find")
|
||||
|
||||
# mark
|
||||
layout.itemO("text.mark_all")
|
||||
# replace
|
||||
col = layout.column(align=True)
|
||||
row = col.row()
|
||||
row.itemR(st, "replace_text", text="")
|
||||
row.itemO("text.replace_set_selected", text="", icon='ICON_TEXT')
|
||||
col.itemO("text.replace")
|
||||
|
||||
# settings
|
||||
row = layout.row()
|
||||
row.itemR(st, "find_wrap", text="Wrap")
|
||||
row.itemR(st, "find_all", text="All")
|
||||
# mark
|
||||
layout.itemO("text.mark_all")
|
||||
|
||||
# settings
|
||||
row = layout.row()
|
||||
row.itemR(st, "find_wrap", text="Wrap")
|
||||
row.itemR(st, "find_all", text="All")
|
||||
|
||||
class TEXT_MT_text(bpy.types.Menu):
|
||||
bl_label = "Text"
|
||||
bl_label = "Text"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
st = context.space_data
|
||||
text = st.text
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
layout.column()
|
||||
layout.itemO("text.new")
|
||||
layout.itemO("text.open")
|
||||
st = context.space_data
|
||||
text = st.text
|
||||
|
||||
if text:
|
||||
layout.itemO("text.reload")
|
||||
layout.column()
|
||||
layout.itemO("text.new")
|
||||
layout.itemO("text.open")
|
||||
|
||||
layout.column()
|
||||
layout.itemO("text.save")
|
||||
layout.itemO("text.save_as")
|
||||
if text:
|
||||
layout.itemO("text.reload")
|
||||
|
||||
if text.filename != "":
|
||||
layout.itemO("text.make_internal")
|
||||
layout.column()
|
||||
layout.itemO("text.save")
|
||||
layout.itemO("text.save_as")
|
||||
|
||||
layout.column()
|
||||
layout.itemO("text.run_script")
|
||||
if text.filename != "":
|
||||
layout.itemO("text.make_internal")
|
||||
|
||||
#ifndef DISABLE_PYTHON
|
||||
# XXX if(BPY_is_pyconstraint(text))
|
||||
# XXX uiMenuItemO(head, 0, "text.refresh_pyconstraints");
|
||||
#endif
|
||||
layout.column()
|
||||
layout.itemO("text.run_script")
|
||||
|
||||
layout.itemS()
|
||||
#ifndef DISABLE_PYTHON
|
||||
# XXX if(BPY_is_pyconstraint(text))
|
||||
# XXX uiMenuItemO(head, 0, "text.refresh_pyconstraints");
|
||||
#endif
|
||||
|
||||
layout.itemS()
|
||||
|
||||
layout.itemO("text.properties", icon='ICON_MENU_PANEL')
|
||||
|
||||
|
||||
|
||||
#ifndef DISABLE_PYTHON
|
||||
# XXX layout.column()
|
||||
# XXX uiDefIconTextBlockBut(block, text_template_scriptsmenu, NULL, ICON_RIGHTARROW_THIN, "Script Templates", 0, yco-=20, 120, 19, "");
|
||||
# XXX uiDefIconTextBlockBut(block, text_plugin_scriptsmenu, NULL, ICON_RIGHTARROW_THIN, "Text Plugins", 0, yco-=20, 120, 19, "");
|
||||
#endif
|
||||
|
||||
layout.itemM("TEXT_MT_templates")
|
||||
|
||||
layout.itemO("text.properties", icon='ICON_MENU_PANEL')
|
||||
|
||||
|
||||
|
||||
#ifndef DISABLE_PYTHON
|
||||
# XXX layout.column()
|
||||
# XXX uiDefIconTextBlockBut(block, text_template_scriptsmenu, NULL, ICON_RIGHTARROW_THIN, "Script Templates", 0, yco-=20, 120, 19, "");
|
||||
# XXX uiDefIconTextBlockBut(block, text_plugin_scriptsmenu, NULL, ICON_RIGHTARROW_THIN, "Text Plugins", 0, yco-=20, 120, 19, "");
|
||||
#endif
|
||||
|
||||
layout.itemM("TEXT_MT_templates")
|
||||
|
||||
|
||||
|
||||
class TEXT_MT_templates(bpy.types.Menu):
|
||||
'''
|
||||
Creates the menu items by scanning scripts/templates
|
||||
'''
|
||||
bl_label = "Script Templates"
|
||||
|
||||
def draw(self, context):
|
||||
import os
|
||||
|
||||
def path_to_name(f):
|
||||
f_base = os.path.splitext(f)[0]
|
||||
f_base = f_base.replace("_", " ")
|
||||
return ' '.join([w[0].upper() + w[1:] for w in f_base.split()])
|
||||
|
||||
layout = self.layout
|
||||
template_dir = os.path.join(os.path.dirname(__file__), os.path.pardir, "templates")
|
||||
|
||||
for f in sorted(os.listdir(template_dir)):
|
||||
|
||||
if f.startswith("."):
|
||||
continue
|
||||
|
||||
path = os.path.join(template_dir, f)
|
||||
layout.item_stringO("text.open", "path", path, text=path_to_name(f))
|
||||
'''
|
||||
Creates the menu items by scanning scripts/templates
|
||||
'''
|
||||
bl_label = "Script Templates"
|
||||
|
||||
def draw(self, context):
|
||||
import os
|
||||
|
||||
def path_to_name(f):
|
||||
f_base = os.path.splitext(f)[0]
|
||||
f_base = f_base.replace("_", " ")
|
||||
return ' '.join([w[0].upper() + w[1:] for w in f_base.split()])
|
||||
|
||||
layout = self.layout
|
||||
template_dir = os.path.join(os.path.dirname(__file__), os.path.pardir, "templates")
|
||||
|
||||
for f in sorted(os.listdir(template_dir)):
|
||||
|
||||
if f.startswith("."):
|
||||
continue
|
||||
|
||||
path = os.path.join(template_dir, f)
|
||||
layout.item_stringO("text.open", "path", path, text=path_to_name(f))
|
||||
|
||||
|
||||
|
||||
class TEXT_MT_edit_view(bpy.types.Menu):
|
||||
bl_label = "View"
|
||||
bl_label = "View"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
layout.item_enumO("text.move", "type", 'FILE_TOP', text="Top of File")
|
||||
layout.item_enumO("text.move", "type", 'FILE_BOTTOM', text="Bottom of File")
|
||||
layout.item_enumO("text.move", "type", 'FILE_TOP', text="Top of File")
|
||||
layout.item_enumO("text.move", "type", 'FILE_BOTTOM', text="Bottom of File")
|
||||
|
||||
class TEXT_MT_edit_select(bpy.types.Menu):
|
||||
bl_label = "Select"
|
||||
bl_label = "Select"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
layout.itemO("text.select_all")
|
||||
layout.itemO("text.select_line")
|
||||
layout.itemO("text.select_all")
|
||||
layout.itemO("text.select_line")
|
||||
|
||||
class TEXT_MT_edit_markers(bpy.types.Menu):
|
||||
bl_label = "Markers"
|
||||
bl_label = "Markers"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
layout.itemO("text.markers_clear")
|
||||
layout.itemO("text.next_marker")
|
||||
layout.itemO("text.previous_marker")
|
||||
layout.itemO("text.markers_clear")
|
||||
layout.itemO("text.next_marker")
|
||||
layout.itemO("text.previous_marker")
|
||||
|
||||
class TEXT_MT_format(bpy.types.Menu):
|
||||
bl_label = "Format"
|
||||
bl_label = "Format"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
layout.itemO("text.indent")
|
||||
layout.itemO("text.unindent")
|
||||
layout.itemO("text.indent")
|
||||
layout.itemO("text.unindent")
|
||||
|
||||
layout.itemS()
|
||||
layout.itemS()
|
||||
|
||||
layout.itemO("text.comment")
|
||||
layout.itemO("text.uncomment")
|
||||
layout.itemO("text.comment")
|
||||
layout.itemO("text.uncomment")
|
||||
|
||||
layout.itemS()
|
||||
layout.itemS()
|
||||
|
||||
layout.item_menu_enumO("text.convert_whitespace", "type")
|
||||
layout.item_menu_enumO("text.convert_whitespace", "type")
|
||||
|
||||
class TEXT_MT_edit_to3d(bpy.types.Menu):
|
||||
bl_label = "Text To 3D Object"
|
||||
bl_label = "Text To 3D Object"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
layout.item_booleanO("text.to_3d_object", "split_lines", False, text="One Object");
|
||||
layout.item_booleanO("text.to_3d_object", "split_lines", True, text="One Object Per Line");
|
||||
layout.item_booleanO("text.to_3d_object", "split_lines", False, text="One Object");
|
||||
layout.item_booleanO("text.to_3d_object", "split_lines", True, text="One Object Per Line");
|
||||
|
||||
class TEXT_MT_edit(bpy.types.Menu):
|
||||
bl_label = "Edit"
|
||||
bl_label = "Edit"
|
||||
|
||||
def poll(self, context):
|
||||
return (context.space_data.text)
|
||||
def poll(self, context):
|
||||
return (context.space_data.text)
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
layout.itemO("ed.undo")
|
||||
layout.itemO("ed.redo")
|
||||
layout.itemO("ed.undo")
|
||||
layout.itemO("ed.redo")
|
||||
|
||||
layout.itemS()
|
||||
layout.itemS()
|
||||
|
||||
layout.itemO("text.cut")
|
||||
layout.itemO("text.copy")
|
||||
layout.itemO("text.paste")
|
||||
layout.itemO("text.cut")
|
||||
layout.itemO("text.copy")
|
||||
layout.itemO("text.paste")
|
||||
|
||||
layout.itemS()
|
||||
layout.itemS()
|
||||
|
||||
layout.itemM("TEXT_MT_edit_view")
|
||||
layout.itemM("TEXT_MT_edit_select")
|
||||
layout.itemM("TEXT_MT_edit_markers")
|
||||
layout.itemM("TEXT_MT_edit_view")
|
||||
layout.itemM("TEXT_MT_edit_select")
|
||||
layout.itemM("TEXT_MT_edit_markers")
|
||||
|
||||
layout.itemS()
|
||||
layout.itemS()
|
||||
|
||||
layout.itemO("text.jump")
|
||||
layout.itemO("text.properties", text="Find...")
|
||||
layout.itemO("text.jump")
|
||||
layout.itemO("text.properties", text="Find...")
|
||||
|
||||
layout.itemS()
|
||||
layout.itemS()
|
||||
|
||||
layout.itemM("TEXT_MT_edit_to3d")
|
||||
layout.itemM("TEXT_MT_edit_to3d")
|
||||
|
||||
bpy.types.register(TEXT_HT_header)
|
||||
bpy.types.register(TEXT_PT_properties)
|
||||
|
@ -2,143 +2,143 @@
|
||||
import bpy
|
||||
|
||||
class TIME_HT_header(bpy.types.Header):
|
||||
bl_space_type = 'TIMELINE'
|
||||
bl_space_type = 'TIMELINE'
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
st = context.space_data
|
||||
scene = context.scene
|
||||
tools = context.tool_settings
|
||||
screen = context.screen
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
row = layout.row(align=True)
|
||||
row.template_header()
|
||||
st = context.space_data
|
||||
scene = context.scene
|
||||
tools = context.tool_settings
|
||||
screen = context.screen
|
||||
|
||||
if context.area.show_menus:
|
||||
sub = row.row(align=True)
|
||||
sub.itemM("TIME_MT_view")
|
||||
sub.itemM("TIME_MT_frame")
|
||||
sub.itemM("TIME_MT_playback")
|
||||
row = layout.row(align=True)
|
||||
row.template_header()
|
||||
|
||||
layout.itemR(scene, "use_preview_range", text="PR")
|
||||
|
||||
row = layout.row(align=True)
|
||||
if not scene.use_preview_range:
|
||||
row.itemR(scene, "start_frame", text="Start")
|
||||
row.itemR(scene, "end_frame", text="End")
|
||||
else:
|
||||
row.itemR(scene, "preview_range_start_frame", text="Start")
|
||||
row.itemR(scene, "preview_range_end_frame", text="End")
|
||||
|
||||
layout.itemR(scene, "current_frame", text="")
|
||||
|
||||
layout.itemS()
|
||||
if context.area.show_menus:
|
||||
sub = row.row(align=True)
|
||||
sub.itemM("TIME_MT_view")
|
||||
sub.itemM("TIME_MT_frame")
|
||||
sub.itemM("TIME_MT_playback")
|
||||
|
||||
row = layout.row(align=True)
|
||||
row.item_booleanO("screen.frame_jump", "end", False, text="", icon='ICON_REW')
|
||||
row.item_booleanO("screen.keyframe_jump", "next", False, text="", icon='ICON_PREV_KEYFRAME')
|
||||
if not screen.animation_playing:
|
||||
row.item_booleanO("screen.animation_play", "reverse", True, text="", icon='ICON_PLAY_REVERSE')
|
||||
row.itemO("screen.animation_play", text="", icon='ICON_PLAY')
|
||||
else:
|
||||
sub = row.row()
|
||||
sub.scale_x = 2.0
|
||||
sub.itemO("screen.animation_play", text="", icon='ICON_PAUSE')
|
||||
row.item_booleanO("screen.keyframe_jump", "next", True, text="", icon='ICON_NEXT_KEYFRAME')
|
||||
row.item_booleanO("screen.frame_jump", "end", True, text="", icon='ICON_FF')
|
||||
|
||||
row = layout.row(align=True)
|
||||
row.itemR(tools, "enable_auto_key", text="", toggle=True, icon='ICON_REC')
|
||||
if screen.animation_playing and tools.enable_auto_key:
|
||||
subsub = row.row()
|
||||
subsub.itemR(tools, "record_with_nla", toggle=True)
|
||||
|
||||
layout.itemR(scene, "sync_audio", text="", toggle=True, icon='ICON_SPEAKER')
|
||||
|
||||
layout.itemS()
|
||||
|
||||
row = layout.row(align=True)
|
||||
row.item_pointerR(scene, "active_keying_set", scene, "keying_sets", text="")
|
||||
row.itemO("anim.insert_keyframe", text="", icon='ICON_KEY_HLT')
|
||||
row.itemO("anim.delete_keyframe", text="", icon='ICON_KEY_DEHLT')
|
||||
layout.itemR(scene, "use_preview_range", text="PR")
|
||||
|
||||
row = layout.row(align=True)
|
||||
if not scene.use_preview_range:
|
||||
row.itemR(scene, "start_frame", text="Start")
|
||||
row.itemR(scene, "end_frame", text="End")
|
||||
else:
|
||||
row.itemR(scene, "preview_range_start_frame", text="Start")
|
||||
row.itemR(scene, "preview_range_end_frame", text="End")
|
||||
|
||||
layout.itemR(scene, "current_frame", text="")
|
||||
|
||||
layout.itemS()
|
||||
|
||||
row = layout.row(align=True)
|
||||
row.item_booleanO("screen.frame_jump", "end", False, text="", icon='ICON_REW')
|
||||
row.item_booleanO("screen.keyframe_jump", "next", False, text="", icon='ICON_PREV_KEYFRAME')
|
||||
if not screen.animation_playing:
|
||||
row.item_booleanO("screen.animation_play", "reverse", True, text="", icon='ICON_PLAY_REVERSE')
|
||||
row.itemO("screen.animation_play", text="", icon='ICON_PLAY')
|
||||
else:
|
||||
sub = row.row()
|
||||
sub.scale_x = 2.0
|
||||
sub.itemO("screen.animation_play", text="", icon='ICON_PAUSE')
|
||||
row.item_booleanO("screen.keyframe_jump", "next", True, text="", icon='ICON_NEXT_KEYFRAME')
|
||||
row.item_booleanO("screen.frame_jump", "end", True, text="", icon='ICON_FF')
|
||||
|
||||
row = layout.row(align=True)
|
||||
row.itemR(tools, "enable_auto_key", text="", toggle=True, icon='ICON_REC')
|
||||
if screen.animation_playing and tools.enable_auto_key:
|
||||
subsub = row.row()
|
||||
subsub.itemR(tools, "record_with_nla", toggle=True)
|
||||
|
||||
layout.itemR(scene, "sync_audio", text="", toggle=True, icon='ICON_SPEAKER')
|
||||
|
||||
layout.itemS()
|
||||
|
||||
row = layout.row(align=True)
|
||||
row.item_pointerR(scene, "active_keying_set", scene, "keying_sets", text="")
|
||||
row.itemO("anim.insert_keyframe", text="", icon='ICON_KEY_HLT')
|
||||
row.itemO("anim.delete_keyframe", text="", icon='ICON_KEY_DEHLT')
|
||||
|
||||
class TIME_MT_view(bpy.types.Menu):
|
||||
bl_label = "View"
|
||||
bl_label = "View"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
st = context.space_data
|
||||
|
||||
layout.itemO("anim.time_toggle")
|
||||
|
||||
layout.itemS()
|
||||
|
||||
layout.itemR(st, "only_selected")
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
st = context.space_data
|
||||
|
||||
layout.itemO("anim.time_toggle")
|
||||
|
||||
layout.itemS()
|
||||
|
||||
layout.itemR(st, "only_selected")
|
||||
|
||||
class TIME_MT_frame(bpy.types.Menu):
|
||||
bl_label = "Frame"
|
||||
bl_label = "Frame"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
tools = context.tool_settings
|
||||
|
||||
layout.itemO("marker.add", text="Add Marker")
|
||||
layout.itemO("marker.duplicate", text="Duplicate Marker")
|
||||
layout.itemO("marker.move", text="Grab/Move Marker")
|
||||
layout.itemO("marker.delete", text="Delete Marker")
|
||||
layout.itemL(text="ToDo: Name Marker")
|
||||
|
||||
layout.itemS()
|
||||
|
||||
layout.itemO("time.start_frame_set")
|
||||
layout.itemO("time.end_frame_set")
|
||||
|
||||
layout.itemS()
|
||||
|
||||
sub = layout.row()
|
||||
#sub.active = tools.enable_auto_key
|
||||
sub.itemM("TIME_MT_autokey")
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
tools = context.tool_settings
|
||||
|
||||
layout.itemO("marker.add", text="Add Marker")
|
||||
layout.itemO("marker.duplicate", text="Duplicate Marker")
|
||||
layout.itemO("marker.move", text="Grab/Move Marker")
|
||||
layout.itemO("marker.delete", text="Delete Marker")
|
||||
layout.itemL(text="ToDo: Name Marker")
|
||||
|
||||
layout.itemS()
|
||||
|
||||
layout.itemO("time.start_frame_set")
|
||||
layout.itemO("time.end_frame_set")
|
||||
|
||||
layout.itemS()
|
||||
|
||||
sub = layout.row()
|
||||
#sub.active = tools.enable_auto_key
|
||||
sub.itemM("TIME_MT_autokey")
|
||||
|
||||
class TIME_MT_playback(bpy.types.Menu):
|
||||
bl_label = "Playback"
|
||||
bl_label = "Playback"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
st = context.space_data
|
||||
scene = context.scene
|
||||
|
||||
layout.itemR(st, "play_top_left")
|
||||
layout.itemR(st, "play_all_3d")
|
||||
layout.itemR(st, "play_anim")
|
||||
layout.itemR(st, "play_buttons")
|
||||
layout.itemR(st, "play_image")
|
||||
layout.itemR(st, "play_sequencer")
|
||||
layout.itemR(st, "play_nodes")
|
||||
|
||||
layout.itemS()
|
||||
|
||||
layout.itemR(st, "continue_physics")
|
||||
|
||||
layout.itemS()
|
||||
|
||||
layout.itemR(scene, "sync_audio", icon='ICON_SPEAKER')
|
||||
layout.itemR(scene, "mute_audio")
|
||||
layout.itemR(scene, "scrub_audio")
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
st = context.space_data
|
||||
scene = context.scene
|
||||
|
||||
layout.itemR(st, "play_top_left")
|
||||
layout.itemR(st, "play_all_3d")
|
||||
layout.itemR(st, "play_anim")
|
||||
layout.itemR(st, "play_buttons")
|
||||
layout.itemR(st, "play_image")
|
||||
layout.itemR(st, "play_sequencer")
|
||||
layout.itemR(st, "play_nodes")
|
||||
|
||||
layout.itemS()
|
||||
|
||||
layout.itemR(st, "continue_physics")
|
||||
|
||||
layout.itemS()
|
||||
|
||||
layout.itemR(scene, "sync_audio", icon='ICON_SPEAKER')
|
||||
layout.itemR(scene, "mute_audio")
|
||||
layout.itemR(scene, "scrub_audio")
|
||||
|
||||
class TIME_MT_autokey(bpy.types.Menu):
|
||||
bl_label = "Auto-Keyframing Mode"
|
||||
bl_label = "Auto-Keyframing Mode"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
tools = context.tool_settings
|
||||
|
||||
layout.active = tools.enable_auto_key
|
||||
|
||||
layout.item_enumR(tools, "autokey_mode", 'ADD_REPLACE_KEYS')
|
||||
layout.item_enumR(tools, "autokey_mode", 'REPLACE_KEYS')
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
tools = context.tool_settings
|
||||
|
||||
layout.active = tools.enable_auto_key
|
||||
|
||||
layout.item_enumR(tools, "autokey_mode", 'ADD_REPLACE_KEYS')
|
||||
layout.item_enumR(tools, "autokey_mode", 'REPLACE_KEYS')
|
||||
|
||||
bpy.types.register(TIME_HT_header)
|
||||
bpy.types.register(TIME_MT_view)
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -19,114 +19,114 @@
|
||||
# #**** END GPL LICENSE BLOCK #****
|
||||
|
||||
if 1:
|
||||
# Print once every 1000
|
||||
GEN_PATH = True
|
||||
PRINT_DATA = False
|
||||
PRINT_DATA_INT = 1000
|
||||
VERBOSE = False
|
||||
VERBOSE_TYPE = False
|
||||
MAX_RECURSIVE = 8
|
||||
# Print once every 1000
|
||||
GEN_PATH = True
|
||||
PRINT_DATA = False
|
||||
PRINT_DATA_INT = 1000
|
||||
VERBOSE = False
|
||||
VERBOSE_TYPE = False
|
||||
MAX_RECURSIVE = 8
|
||||
else:
|
||||
# Print everything
|
||||
GEN_PATH = True
|
||||
PRINT_DATA = True
|
||||
PRINT_DATA_INT = 0
|
||||
VERBOSE = False
|
||||
VERBOSE_TYPE = False
|
||||
MAX_RECURSIVE = 8
|
||||
# Print everything
|
||||
GEN_PATH = True
|
||||
PRINT_DATA = True
|
||||
PRINT_DATA_INT = 0
|
||||
VERBOSE = False
|
||||
VERBOSE_TYPE = False
|
||||
MAX_RECURSIVE = 8
|
||||
|
||||
seek_count = [0]
|
||||
|
||||
def seek(r, txt, recurs):
|
||||
|
||||
seek_count[0] += 1
|
||||
|
||||
if PRINT_DATA_INT:
|
||||
if not (seek_count[0] % PRINT_DATA_INT):
|
||||
print(seek_count[0], txt)
|
||||
|
||||
if PRINT_DATA:
|
||||
print(txt)
|
||||
|
||||
newtxt = ''
|
||||
|
||||
if recurs > MAX_RECURSIVE:
|
||||
#print ("Recursion is over max")
|
||||
#print (txt)
|
||||
return
|
||||
|
||||
type_r = type(r)
|
||||
|
||||
# print(type_r)
|
||||
# print(dir(r))
|
||||
|
||||
# basic types
|
||||
if type_r in (float, int, bool, type(None)):
|
||||
if PRINT_DATA:
|
||||
print(txt + ' -> ' + str(r))
|
||||
return
|
||||
|
||||
if type_r == str:
|
||||
if PRINT_DATA:
|
||||
print(txt + ' -> "' + str(r) + '"')
|
||||
return
|
||||
|
||||
try: keys = r.keys()
|
||||
except: keys = None
|
||||
|
||||
if keys != None:
|
||||
if PRINT_DATA:
|
||||
print(txt + '.keys() - ' + str(r.keys()))
|
||||
|
||||
try: __members__ = dir(r)
|
||||
except: __members__ = []
|
||||
|
||||
for item in __members__:
|
||||
if item.startswith('__'):
|
||||
continue
|
||||
|
||||
if GEN_PATH: newtxt = txt + '.' + item
|
||||
|
||||
if item == 'rna_type' and VERBOSE_TYPE==False: # just avoid because it spits out loads of data
|
||||
continue
|
||||
|
||||
try: value = getattr(r, item)
|
||||
except: value = None
|
||||
|
||||
seek( value, newtxt, recurs + 1)
|
||||
|
||||
|
||||
if keys:
|
||||
for k in keys:
|
||||
if GEN_PATH: newtxt = txt + '["' + k + '"]'
|
||||
seek(r.__getitem__(k), newtxt, recurs+1)
|
||||
|
||||
else:
|
||||
try: length = len( r )
|
||||
except: length = 0
|
||||
|
||||
if VERBOSE==False and length >= 4:
|
||||
for i in (0, length-1):
|
||||
if i>0:
|
||||
if PRINT_DATA:
|
||||
print((' '*len(txt)) + ' ... skipping '+str(length-2)+' items ...')
|
||||
|
||||
if GEN_PATH: newtxt = txt + '[' + str(i) + ']'
|
||||
seek(r[i], newtxt, recurs+1)
|
||||
else:
|
||||
for i in range(length):
|
||||
if GEN_PATH: newtxt = txt + '[' + str(i) + ']'
|
||||
seek(r[i], newtxt, recurs+1)
|
||||
|
||||
seek_count[0] += 1
|
||||
|
||||
if PRINT_DATA_INT:
|
||||
if not (seek_count[0] % PRINT_DATA_INT):
|
||||
print(seek_count[0], txt)
|
||||
|
||||
if PRINT_DATA:
|
||||
print(txt)
|
||||
|
||||
newtxt = ''
|
||||
|
||||
if recurs > MAX_RECURSIVE:
|
||||
#print ("Recursion is over max")
|
||||
#print (txt)
|
||||
return
|
||||
|
||||
type_r = type(r)
|
||||
|
||||
# print(type_r)
|
||||
# print(dir(r))
|
||||
|
||||
# basic types
|
||||
if type_r in (float, int, bool, type(None)):
|
||||
if PRINT_DATA:
|
||||
print(txt + ' -> ' + str(r))
|
||||
return
|
||||
|
||||
if type_r == str:
|
||||
if PRINT_DATA:
|
||||
print(txt + ' -> "' + str(r) + '"')
|
||||
return
|
||||
|
||||
try: keys = r.keys()
|
||||
except: keys = None
|
||||
|
||||
if keys != None:
|
||||
if PRINT_DATA:
|
||||
print(txt + '.keys() - ' + str(r.keys()))
|
||||
|
||||
try: __members__ = dir(r)
|
||||
except: __members__ = []
|
||||
|
||||
for item in __members__:
|
||||
if item.startswith('__'):
|
||||
continue
|
||||
|
||||
if GEN_PATH: newtxt = txt + '.' + item
|
||||
|
||||
if item == 'rna_type' and VERBOSE_TYPE==False: # just avoid because it spits out loads of data
|
||||
continue
|
||||
|
||||
try: value = getattr(r, item)
|
||||
except: value = None
|
||||
|
||||
seek( value, newtxt, recurs + 1)
|
||||
|
||||
|
||||
if keys:
|
||||
for k in keys:
|
||||
if GEN_PATH: newtxt = txt + '["' + k + '"]'
|
||||
seek(r.__getitem__(k), newtxt, recurs+1)
|
||||
|
||||
else:
|
||||
try: length = len( r )
|
||||
except: length = 0
|
||||
|
||||
if VERBOSE==False and length >= 4:
|
||||
for i in (0, length-1):
|
||||
if i>0:
|
||||
if PRINT_DATA:
|
||||
print((' '*len(txt)) + ' ... skipping '+str(length-2)+' items ...')
|
||||
|
||||
if GEN_PATH: newtxt = txt + '[' + str(i) + ']'
|
||||
seek(r[i], newtxt, recurs+1)
|
||||
else:
|
||||
for i in range(length):
|
||||
if GEN_PATH: newtxt = txt + '[' + str(i) + ']'
|
||||
seek(r[i], newtxt, recurs+1)
|
||||
|
||||
seek(bpy.data, 'bpy.data', 0)
|
||||
# seek(bpy.types, 'bpy.types', 0)
|
||||
'''
|
||||
for d in dir(bpy.types):
|
||||
t = getattr(bpy.types, d)
|
||||
try: r = t.bl_rna
|
||||
except: r = None
|
||||
if r:
|
||||
seek(r, 'bpy.types.' + d + '.bl_rna', 0)
|
||||
t = getattr(bpy.types, d)
|
||||
try: r = t.bl_rna
|
||||
except: r = None
|
||||
if r:
|
||||
seek(r, 'bpy.types.' + d + '.bl_rna', 0)
|
||||
'''
|
||||
|
||||
#print dir(bpy)
|
||||
|
@ -19,47 +19,47 @@
|
||||
# #**** END GPL LICENSE BLOCK #****
|
||||
|
||||
defs = """
|
||||
SPACE_EMPTY,
|
||||
SPACE_VIEW3D,
|
||||
SPACE_IPO,
|
||||
SPACE_OUTLINER,
|
||||
SPACE_BUTS,
|
||||
SPACE_FILE,
|
||||
SPACE_IMAGE,
|
||||
SPACE_INFO,
|
||||
SPACE_SEQ,
|
||||
SPACE_TEXT,
|
||||
SPACE_IMASEL,
|
||||
SPACE_SOUND,
|
||||
SPACE_ACTION,
|
||||
SPACE_NLA,
|
||||
SPACE_SCRIPT,
|
||||
SPACE_TIME,
|
||||
SPACE_NODE,
|
||||
SPACEICONMAX
|
||||
SPACE_EMPTY,
|
||||
SPACE_VIEW3D,
|
||||
SPACE_IPO,
|
||||
SPACE_OUTLINER,
|
||||
SPACE_BUTS,
|
||||
SPACE_FILE,
|
||||
SPACE_IMAGE,
|
||||
SPACE_INFO,
|
||||
SPACE_SEQ,
|
||||
SPACE_TEXT,
|
||||
SPACE_IMASEL,
|
||||
SPACE_SOUND,
|
||||
SPACE_ACTION,
|
||||
SPACE_NLA,
|
||||
SPACE_SCRIPT,
|
||||
SPACE_TIME,
|
||||
SPACE_NODE,
|
||||
SPACEICONMAX
|
||||
"""
|
||||
|
||||
print '\tmod = PyModule_New("dummy");'
|
||||
print '\tPyModule_AddObject( submodule, "key", mod );'
|
||||
|
||||
for d in defs.split('\n'):
|
||||
|
||||
d = d.replace(',', ' ')
|
||||
w = d.split()
|
||||
|
||||
if not w:
|
||||
continue
|
||||
|
||||
try: w.remove("#define")
|
||||
except: pass
|
||||
|
||||
# print w
|
||||
|
||||
val = w[0]
|
||||
py_val = w[0]
|
||||
|
||||
print '\tPyModule_AddObject( mod, "%s", PyLong_FromSize_t(%s) );' % (val, py_val)
|
||||
|
||||
|
||||
d = d.replace(',', ' ')
|
||||
w = d.split()
|
||||
|
||||
if not w:
|
||||
continue
|
||||
|
||||
try: w.remove("#define")
|
||||
except: pass
|
||||
|
||||
# print w
|
||||
|
||||
val = w[0]
|
||||
py_val = w[0]
|
||||
|
||||
print '\tPyModule_AddObject( mod, "%s", PyLong_FromSize_t(%s) );' % (val, py_val)
|
||||
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user