Page MenuHome

quickPrefs.py

File Metadata

Author
Sean Olson (liquidape)
Created
Nov 13 2013, 3:25 PM

quickPrefs.py

# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ##### END GPL LICENSE BLOCK #####
bl_info = {
"name": "QuickPrefs",
"author": "Sean Olson",
"version": (2,0),
"blender": (2, 6, 4),
"api": 50316,
"location": "3DView->Properties Panel (N-Key)",
"description": "Add often changed User Preference options to Properties panel.",
"warning": "",
"wiki_url": "",
"tracker_url": "",
"category": "3D View"}
import bpy
from bpy.types import Menu, Panel
from rna_prop_ui import PropertyPanel
recursive = False
renaming = True
lastindex = 0
lastname = ""
lastscene = ""
##########################################
####### General Functions ################
##########################################
def values(scn):
bpy.types.Scene.lights = bpy.props.BoolProperty(name='Lights', default=False)
bpy.types.Scene.lightPresets = bpy.props.BoolProperty(name='Light Presets', default=False)
bpy.types.Scene.interface = bpy.props.BoolProperty(name='Interface', default=False)
def opengl_lamp_buttons(column, lamp):
split = column.split(percentage=0.1)
split.prop(lamp, "use", text="", icon='OUTLINER_OB_LAMP' if lamp.use else 'LAMP_DATA')
col = split.column()
col.active = lamp.use
row = col.row()
row.label(text="Diffuse:")
row.prop(lamp, "diffuse_color", text="")
row = col.row()
row.label(text="Specular:")
row.prop(lamp, "specular_color", text="")
col = split.column()
col.active = lamp.use
col.prop(lamp, "direction", text="")
##########################################
####### General Presets Functions #######
##########################################
def gllightpreset_addPresets():
bpy.context.user_preferences.system.solid_lights[0].use=True
bpy.context.user_preferences.system.solid_lights[1].use=True
bpy.context.user_preferences.system.solid_lights[2].use=True
bpy.context.user_preferences.system.solid_lights[0].direction = (-0.3207547068595886, 0.4245283007621765, 0.846694827079773)
bpy.context.user_preferences.system.solid_lights[1].direction = (0.42592597007751465, -0.055555559694767, 0.9030508399009705)
bpy.context.user_preferences.system.solid_lights[2].direction = (-0.4485141932964325, 0.2400498390197754, -0.8609362244606018)
bpy.context.user_preferences.system.solid_lights[0].diffuse_color=(0.4292164444923401, 0.04578309506177902, 0.04578309506177902)
bpy.context.user_preferences.system.solid_lights[1].diffuse_color=(0.7873858213424683, 0.44240525364875793, 0.28939929604530334)
bpy.context.user_preferences.system.solid_lights[2].diffuse_color=(0.7483883500099182, 0.7168357372283936, 0.6764323711395264)
bpy.context.user_preferences.system.solid_lights[0].specular_color=(0.20000000298023224, 0.20000000298023224, 0.20000000298023224)
bpy.context.user_preferences.system.solid_lights[1].specular_color=(0.0, 0.0, 0.0)
bpy.context.user_preferences.system.solid_lights[2].specular_color=(0.0, 0.0, 0.0)
gllightpreset_add("Orange Clay")
gllightpreset_save()
bpy.context.user_preferences.system.solid_lights[0].use=True
bpy.context.user_preferences.system.solid_lights[1].use=True
bpy.context.user_preferences.system.solid_lights[2].use=True
bpy.context.user_preferences.system.solid_lights[0].direction=(-0.06666667014360428, 0.8222222328186035, 0.5652487874031067)
bpy.context.user_preferences.system.solid_lights[1].direction=(-0.8555555939674377, 0.1111111119389534, 0.5056471228599548)
bpy.context.user_preferences.system.solid_lights[2].direction=(0.9000000357627869, 0.15555556118488312, 0.4071885049343109)
bpy.context.user_preferences.system.solid_lights[0].diffuse_color=(0.10000000298023224, 0.10000000298023224, 0.10000000298023224)
bpy.context.user_preferences.system.solid_lights[1].diffuse_color=(1.0, 0.973445475101471, 0.8713672161102295)
bpy.context.user_preferences.system.solid_lights[2].diffuse_color=(0.7835379242897034, 0.9215819239616394, 1.0)
bpy.context.user_preferences.system.solid_lights[0].specular_color=(0.0, 0.0, 0.0)
bpy.context.user_preferences.system.solid_lights[1].specular_color=(0.0, 0.0, 0.0)
bpy.context.user_preferences.system.solid_lights[2].specular_color=(0.0, 0.0, 0.0)
gllightpreset_add("Softblend")
gllightpreset_save()
bpy.context.user_preferences.system.solid_lights[0].use = True
bpy.context.user_preferences.system.solid_lights[1].use = True
bpy.context.user_preferences.system.solid_lights[2].use = True
bpy.context.user_preferences.system.solid_lights[0].direction = (0.36666667461395264, 0.2888889014720917, 0.8843634724617004)
bpy.context.user_preferences.system.solid_lights[1].direction = (0.1111111119389534, 0.08888889104127884, 0.9898247718811035)
bpy.context.user_preferences.system.solid_lights[2].direction = (-0.5142136216163635, 0.5142136216163635, -0.6864173412322998)
bpy.context.user_preferences.system.solid_lights[0].diffuse_color = (0.6618524789810181, 0.5481933951377869, 0.5054783821105957)
bpy.context.user_preferences.system.solid_lights[1].diffuse_color = (0.36722999811172485, 0.23716264963150024, 0.17520619928836823)
bpy.context.user_preferences.system.solid_lights[2].diffuse_color = (1.0, 0.9574944972991943, 0.9058709144592285)
bpy.context.user_preferences.system.solid_lights[0].specular_color = (0.496913343667984, 0.4886576235294342, 0.48209819197654724)
bpy.context.user_preferences.system.solid_lights[1].specular_color = (0.0, 0.0, 0.0)
bpy.context.user_preferences.system.solid_lights[2].specular_color = (1.0, 1.0, 1.0)
gllightpreset_add("Skin")
gllightpreset_save()
bpy.context.user_preferences.system.solid_lights[0].use = True
bpy.context.user_preferences.system.solid_lights[1].use = False
bpy.context.user_preferences.system.solid_lights[2].use = False
bpy.context.user_preferences.system.solid_lights[0].direction = (0.011111111380159855, 0.4000000059604645, 0.9164478182792664)
bpy.context.user_preferences.system.solid_lights[1].direction = (0.1111111119389534, 0.08888889104127884, 0.9898247718811035)
bpy.context.user_preferences.system.solid_lights[2].direction = (-0.5142136216163635, 0.5142136216163635, -0.6864173412322998)
bpy.context.user_preferences.system.solid_lights[0].diffuse_color = (1.0, 0.5912564992904663, 0.414814829826355)
bpy.context.user_preferences.system.solid_lights[1].diffuse_color = (0.4962962865829468, 0.4962962865829468, 0.4962962865829468)
bpy.context.user_preferences.system.solid_lights[2].diffuse_color = (1.0, 0.9574944972991943, 0.9058709144592285)
bpy.context.user_preferences.system.solid_lights[0].specular_color = (0.20361024141311646, 0.42063653469085693, 0.7873865962028503)
bpy.context.user_preferences.system.solid_lights[1].specular_color = (0.0, 0.0, 0.0)
bpy.context.user_preferences.system.solid_lights[2].specular_color = (1.0, 1.0, 1.0)
gllightpreset_add("Candy")
gllightpreset_save();
bpy.context.user_preferences.system.solid_lights[0].use = True
bpy.context.user_preferences.system.solid_lights[1].use = True
bpy.context.user_preferences.system.solid_lights[2].use = True
bpy.context.user_preferences.system.solid_lights[0].direction = (-0.6124030947685242, 0.604651153087616, 0.5092734098434448)
bpy.context.user_preferences.system.solid_lights[1].direction = (0.1627907007932663, 0.5271317958831787, 0.8340451121330261)
bpy.context.user_preferences.system.solid_lights[2].direction = (-0.5858266949653625, 0.7811023592948914, -0.21606986224651337)
bpy.context.user_preferences.system.solid_lights[0].diffuse_color = (0.0, 0.35642480850219727, 0.4292164444923401)
bpy.context.user_preferences.system.solid_lights[1].diffuse_color = (0.7873858213424683, 0.003858924610540271, 0.719732403755188)
bpy.context.user_preferences.system.solid_lights[2].diffuse_color = (0.19940420985221863, 0.20147103071212769, 0.23300935328006744)
bpy.context.user_preferences.system.solid_lights[0].specular_color = (0.09462214261293411, 0.09462214261293411, 0.09462214261293411)
bpy.context.user_preferences.system.solid_lights[1].specular_color = (0.0, 0.0, 0.0)
bpy.context.user_preferences.system.solid_lights[2].specular_color = (0.0, 0.0, 0.0)
gllightpreset_add("Purpleboogers.com")
gllightpreset_save();
bpy.context.user_preferences.system.solid_lights[0].use = True
bpy.context.user_preferences.system.solid_lights[1].use = False
bpy.context.user_preferences.system.solid_lights[2].use = False
bpy.context.user_preferences.system.solid_lights[0].direction = (0.011111111380159855, 0.4000000059604645, 0.9164478182792664)
bpy.context.user_preferences.system.solid_lights[1].direction = (0.1111111119389534, 0.08888889104127884, 0.9898247718811035)
bpy.context.user_preferences.system.solid_lights[2].direction = (-0.5142136216163635, 0.5142136216163635, -0.6864173412322998)
bpy.context.user_preferences.system.solid_lights[0].diffuse_color = (0.800000011920929, 0.800000011920929, 0.800000011920929)
bpy.context.user_preferences.system.solid_lights[1].diffuse_color = (0.4962962865829468, 0.4962962865829468, 0.4962962865829468)
bpy.context.user_preferences.system.solid_lights[2].diffuse_color = (1.0, 0.9574944972991943, 0.9058709144592285)
bpy.context.user_preferences.system.solid_lights[0].specular_color = (0.45405328273773193, 0.45405328273773193, 0.45405328273773193)
bpy.context.user_preferences.system.solid_lights[1].specular_color = (0.0, 0.0, 0.0)
bpy.context.user_preferences.system.solid_lights[2].specular_color = (1.0, 1.0, 1.0)
gllightpreset_add("Dark Gray")
gllightpreset_save()
bpy.context.user_preferences.system.solid_lights[0].use = True
bpy.context.user_preferences.system.solid_lights[1].use = False
bpy.context.user_preferences.system.solid_lights[2].use = False
bpy.context.user_preferences.system.solid_lights[0].direction = (0.03333333507180214, 0.24444444477558136, 0.9690902233123779)
bpy.context.user_preferences.system.solid_lights[1].direction = (0.1111111119389534, 0.08888889104127884, 0.9898247718811035)
bpy.context.user_preferences.system.solid_lights[2].direction = (-0.5142136216163635, 0.5142136216163635, -0.6864173412322998)
bpy.context.user_preferences.system.solid_lights[0].diffuse_color = (0.800000011920929, 0.6670497059822083, 0.602064311504364)
bpy.context.user_preferences.system.solid_lights[1].diffuse_color = (0.4962962865829468, 0.4962962865829468, 0.4962962865829468)
bpy.context.user_preferences.system.solid_lights[2].diffuse_color = (1.0, 0.9574944972991943, 0.9058709144592285)
bpy.context.user_preferences.system.solid_lights[0].specular_color = (0.32812735438346863, 0.32812735438346863, 0.32812735438346863)
bpy.context.user_preferences.system.solid_lights[1].specular_color = (0.0, 0.0, 0.0)
bpy.context.user_preferences.system.solid_lights[2].specular_color = (1.0, 1.0, 1.0)
gllightpreset_add("Turntable")
gllightpreset_save()
bpy.context.user_preferences.system.solid_lights[0].use = True
bpy.context.user_preferences.system.solid_lights[1].use = True
bpy.context.user_preferences.system.solid_lights[2].use = True
bpy.context.user_preferences.system.solid_lights[0].direction = (-0.25555557012557983, 0.5444444417953491, 0.7989190220832825)
bpy.context.user_preferences.system.solid_lights[1].direction = (0.5666666626930237, -0.7333333492279053, 0.3756476044654846)
bpy.context.user_preferences.system.solid_lights[2].direction = (-0.5142136216163635, 0.5142136216163635, -0.6864173412322998)
bpy.context.user_preferences.system.solid_lights[0].diffuse_color = (1.0, 0.9475527405738831, 0.3194773197174072)
bpy.context.user_preferences.system.solid_lights[1].diffuse_color = (0.38518521189689636, 0.29788148403167725, 0.16126196086406708)
bpy.context.user_preferences.system.solid_lights[2].diffuse_color = (1.0, 1.0, 1.0)
bpy.context.user_preferences.system.solid_lights[0].specular_color = (0.27407407760620117, 0.27407407760620117, 0.27407407760620117)
bpy.context.user_preferences.system.solid_lights[1].specular_color = (0.0, 0.0, 0.0)
bpy.context.user_preferences.system.solid_lights[2].specular_color = (0.0, 0.0, 0.0)
gllightpreset_add("Yellow Clay")
gllightpreset_save()
##########################################
####### LightPreset Functions #######
##########################################
def gllightpreset_name(self, context):
global recursive
global renaming
global lastname
if recursive==True: return
recursive=True
tmp=self.name
self.name=self.name+"@temporaryname"
self.name=gllightpreset_checkname(tmp)
tmp=self.name
if renaming==True: gllightpreset_rename(lastname, tmp)
#gllightpreset_sort()
recursive=False
def gllightpreset_checkname(name):
collection=bpy.context.scene.gllightpreset
if name=="": name="Preset"
if not name in collection:
return name
pos = name.rfind(".")
if pos==-1:
name=name+".001"
pos=len(name)-4
for i in range(1, 1000):
nr="00"+str(i)
tmp=name[:pos+1]+nr[len(nr)-3:]
if not tmp in collection:
return tmp
return "Preset.???"
def gllightpreset_rename(old, new):
for o in bpy.context.scene.objects:
if o.get("gllightpreset", "Default")==old:
o.gllightpreset=new
def gllightpreset_index(self, context):
global recursive
if recursive==True: return
recursive=True
scene=bpy.context.scene
if scene.gllightpreset_index > len(scene.gllightpreset)-1:
scene.gllightpreset_index = len(scene.gllightpreset)-1
recursive=False
def gllightpreset_add(name=""):
global renaming
renaming=False
entry=bpy.context.scene.gllightpreset.add()
bpy.context.scene['gllightpreset_index']=len(bpy.context.scene.gllightpreset)-1
entry.name=gllightpreset_checkname(name)
renaming=True
gllightpreset_save()
def gllightpreset_delete():
index=bpy.context.scene.gllightpreset_index
name=bpy.context.scene.gllightpreset[index].name
for o in bpy.context.scene.objects:
if o.get("gllightpreset", "Default")==name:
o.gllightpreset="Default"
bpy.context.scene.gllightpreset.remove(index)
def gllightpreset_save():
index=bpy.context.scene.gllightpreset_index
name=bpy.context.scene.gllightpreset[index].name
bpy.context.scene.gllightpreset[index].illuminated0 = bpy.context.user_preferences.system.solid_lights[0].use
bpy.context.scene.gllightpreset[index].illuminated1 = bpy.context.user_preferences.system.solid_lights[1].use
bpy.context.scene.gllightpreset[index].illuminated2 = bpy.context.user_preferences.system.solid_lights[2].use
bpy.context.scene.gllightpreset[index].direction0 = bpy.context.user_preferences.system.solid_lights[0].direction
bpy.context.scene.gllightpreset[index].direction1 = bpy.context.user_preferences.system.solid_lights[1].direction
bpy.context.scene.gllightpreset[index].direction2 = bpy.context.user_preferences.system.solid_lights[2].direction
bpy.context.scene.gllightpreset[index].diffuse0 = bpy.context.user_preferences.system.solid_lights[0].diffuse_color
bpy.context.scene.gllightpreset[index].diffuse1 = bpy.context.user_preferences.system.solid_lights[1].diffuse_color
bpy.context.scene.gllightpreset[index].diffuse2 = bpy.context.user_preferences.system.solid_lights[2].diffuse_color
bpy.context.scene.gllightpreset[index].specular0 = bpy.context.user_preferences.system.solid_lights[0].specular_color
bpy.context.scene.gllightpreset[index].specular1 = bpy.context.user_preferences.system.solid_lights[1].specular_color
bpy.context.scene.gllightpreset[index].specular2 = bpy.context.user_preferences.system.solid_lights[2].specular_color
#select the current light
def gllightpreset_select():
index=bpy.context.scene.gllightpreset_index
name=bpy.context.scene.gllightpreset[index].name
bpy.context.user_preferences.system.solid_lights[0].use=bpy.context.scene.gllightpreset[index].illuminated0
bpy.context.user_preferences.system.solid_lights[1].use=bpy.context.scene.gllightpreset[index].illuminated1
bpy.context.user_preferences.system.solid_lights[2].use=bpy.context.scene.gllightpreset[index].illuminated2
bpy.context.user_preferences.system.solid_lights[0].direction=bpy.context.scene.gllightpreset[index].direction0
bpy.context.user_preferences.system.solid_lights[1].direction=bpy.context.scene.gllightpreset[index].direction1
bpy.context.user_preferences.system.solid_lights[2].direction=bpy.context.scene.gllightpreset[index].direction2
bpy.context.user_preferences.system.solid_lights[0].diffuse_color=bpy.context.scene.gllightpreset[index].diffuse0
bpy.context.user_preferences.system.solid_lights[1].diffuse_color=bpy.context.scene.gllightpreset[index].diffuse1
bpy.context.user_preferences.system.solid_lights[2].diffuse_color=bpy.context.scene.gllightpreset[index].diffuse2
bpy.context.user_preferences.system.solid_lights[0].specular_color=bpy.context.scene.gllightpreset[index].specular0
bpy.context.user_preferences.system.solid_lights[1].specular_color=bpy.context.scene.gllightpreset[index].specular1
bpy.context.user_preferences.system.solid_lights[2].specular_color=bpy.context.scene.gllightpreset[index].specular2
#sort alphabetically
def gllightpreset_sort():
collection=bpy.context.scene.gllightpreset
count=len(collection)
for i in range(0, count):
for j in range(i+1, count):
if collection[i].name > collection[j].name:
collection.move(j, i)
#Add default setting
def gllightpreset_addDefault():
if not bpy.context.scene.gllightpreset:
gllightpreset_add("(Default)")
gllightpreset_save()
gllightpreset_addPresets()
gllightpreset_sort();
bpy.context.scene['gllightpreset_index']=0
gllightpreset_select()
#scan for changes in the list selection
@bpy.app.handlers.persistent
def gllightpreset_scan(context):
global lastindex
if lastindex!=bpy.context.scene['gllightpreset_index']:
lastindex=bpy.context.scene['gllightpreset_index']
gllightpreset_select()
#--------------------------------------------------ok
##########################################
####### GUI ##############################
##########################################
class gllightpreset(bpy.types.PropertyGroup):
name =bpy.props.StringProperty(update=gllightpreset_name)
illuminated0 = bpy.props.BoolProperty(default = True)
illuminated1 = bpy.props.BoolProperty(default = True)
illuminated2 = bpy.props.BoolProperty(default = True)
diffuse0 = bpy.props.FloatVectorProperty(name="", default=(0.800000011920929, 0.800000011920929, 0.800000011920929))
diffuse1 = bpy.props.FloatVectorProperty(name="", default=(0.4980020225048065, 0.500000536441803, 0.6000001430511475))
diffuse2 = bpy.props.FloatVectorProperty(name="", default=(0.7980005145072937, 0.8379999399185181, 1.0))
specular0 = bpy.props.FloatVectorProperty(name="", default=(0.5, 0.5, 0.5))
specular1 = bpy.props.FloatVectorProperty(name="", default=(0.20000000298023224, 0.20000000298023224, 0.20000000298023224))
specular2 = bpy.props.FloatVectorProperty(name="", default=(0.06599999219179153, 0.0, 0.0))
direction0 = bpy.props.FloatVectorProperty(name="", default=(-0.8920000791549683, 0.30000001192092896, 0.8999999761581421))
direction1 = bpy.props.FloatVectorProperty(name="", default=(0.5880000591278076, 0.46000003814697266, 0.24800002574920654))
direction2 = bpy.props.FloatVectorProperty(name="", default=(0.21599984169006348, -0.3920000195503235, -0.21599996089935303))
count =bpy.props.IntProperty(name="", default=0)
count2 =bpy.props.IntProperty(name="", default=0)
class SCENE_OT_gllightpreset(bpy.types.Operator):
bl_label ="Preset Action"
bl_idname="gllightpreset.action"
button=bpy.props.StringProperty(default="")
def execute(self, context):
button=self.button
if button=="add": gllightpreset_add()
elif button=="delete": gllightpreset_delete()
elif button=="save": gllightpreset_save()
elif button=="sort": gllightpreset_sort()
elif button=="select": gllightpreset_select()
elif action=="select": gllightpreset_select()
scene=bpy.context.scene
if scene.gllightpreset_index > len(scene.gllightpreset)-1:
scene.gllightpreset_index = len(scene.gllightpreset)-1
return {"FINISHED"}
#Panel for tools
class PANEL(bpy.types.Panel):
bl_label = 'Quick Preferences'
bl_space_type = 'VIEW_3D'
bl_context = "render"
bl_region_type = 'UI'
def draw(self, context):
global lastname
scn = bpy.context.scene
system = context.user_preferences.system
inputs = context.user_preferences.inputs
edit = context.user_preferences.edit
layout = self.layout
split = layout.split()
#lights
box = layout.box().column(align=False)
box.prop(scn,'lights')
if scn.lights:
split = box.split(percentage=0.1)
split.label()
split.label(text="Colors:")
split.label(text="Direction:")
lamp = system.solid_lights[0]
opengl_lamp_buttons(box, lamp)
lamp = system.solid_lights[1]
opengl_lamp_buttons(box, lamp)
lamp = system.solid_lights[2]
opengl_lamp_buttons(box, lamp)
box.separator()
#########################
count=len(scn.gllightpreset)
box.template_list(scn, "gllightpreset", scn, "gllightpreset_index", rows=4, maxrows=8)
col=box.row()
col.operator("gllightpreset.action", icon="ZOOMIN", text="").button="add"
col.operator("gllightpreset.action", icon="ZOOMOUT", text="").button="delete"
col.operator("gllightpreset.action", icon="FILE_TICK", text="").button="save"
col.operator("gllightpreset.action", icon="SORTALPHA", text="").button="sort"
if count>0:
entry=scn.gllightpreset[scn.gllightpreset_index]
lastname=entry.name
if entry.count==0:
col.prop(entry, "name", text="")
if entry.count> 0:
col.prop(entry, "name", text="")
if scn.objects.active != None:
name=scn.objects.active.get("gllightpreset", "Default")
##############
#interface options
box = layout.box().column(align=True)
box.prop(scn,'interface')
if scn.interface:
#Select with
boxrow=box.row()
boxrow.label(text="Select With:")
boxrow=box.row()
boxrow.prop(inputs, "select_mouse", expand=True)
#Orbit
boxrow=box.row()
boxrow.label(text="Orbit Style:")
boxrow=box.row()
boxrow.prop(inputs, "view_rotate_method", expand=True)
#continuous grab
boxrow=box.row()
boxrow.prop(inputs, "use_mouse_continuous")
#Color Picker
boxrow=box.row()
boxrow.label(text="Color Picker Type")
boxrow=box.row()
boxrow.row().prop(system, "color_picker_type", text="")
#Align To
boxrow=box.row()
boxrow.label(text="Align New Objects To:")
boxrow=box.row()
boxrow.prop(edit, "object_align", text="")
##########################################
####### Regitration Functions ################
##########################################
def register():
bpy.utils.register_class(PANEL)
values(bpy.context.scene)
bpy.utils.register_class(gllightpreset)
bpy.utils.register_class(SCENE_OT_gllightpreset)
bpy.types.Scene.gllightpreset = bpy.props.CollectionProperty(type=gllightpreset)
bpy.types.Scene.gllightpreset_index = bpy.props.IntProperty(min=0, default=0, update=gllightpreset_index)
bpy.types.Object.gllightpreset = bpy.props.StringProperty()
bpy.app.handlers.scene_update_pre.append(gllightpreset_scan)
gllightpreset_addDefault()
# unregistering and removing menus
def unregister():
bpy.utils.register_class(PANEL)
if __name__ == "__main__":
register()

Event Timeline