Newer
Older
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
clear = False
@classmethod
def poll(cls, context):
return context.active_object.dupli_group
def execute(self, context):
self.__class__.clear = False
ob = context.active_object
amth_text_exists = amaranth_text_startup(context)
script_exists = False
script_intro = "# OB ID: %s" % ob.name
obdata = "bpy.data.objects['%s']" % ob.name
script = "%s" % (
"\nif %(obdata)s and %(obdata)s.dupli_group and %(obdata)s.pass_index != 0: %(obname)s \n"
" for dob in %(obdata)s.dupli_group.objects: %(obname)s \n"
" dob.pass_index = %(obdata)s.pass_index %(obname)s \n" %
{'obdata' : obdata, 'obname' : script_intro})
for txt in bpy.data.texts:
if txt.name == amth_text.name:
for li in txt.lines:
if script_intro == li.body:
script_exists = True
continue
if not script_exists:
amth_text.write("\n")
amth_text.write(script_intro)
amth_text.write(script)
if ob and ob.dupli_group:
if ob.pass_index != 0:
for dob in ob.dupli_group.objects:
dob.pass_index = ob.pass_index
self.report({'INFO'},
"%s ID: %s to all objects in this Dupli Group" % (
"Applied" if not script_exists else "Updated",
ob.pass_index))
return{'FINISHED'}
class AMTH_OBJECT_OT_id_dupligroup_clear(Operator):
'''Clear the Object ID from objects in dupli group'''
bl_idname = "object.amaranth_object_id_duplis_clear"
bl_label = "Clear Object ID from Duplis"
@classmethod
def poll(cls, context):
return context.active_object.dupli_group
def execute(self, context):
context.active_object.pass_index = 0
AMTH_OBJECT_OT_id_dupligroup.clear = True
amth_text_exists = amaranth_text_startup(context)
match_first = "# OB ID: %s" % context.active_object.name
if amth_text_exists:
for txt in bpy.data.texts:
if txt.name == amth_text.name:
for li in txt.lines:
if match_first in li.body:
li.body = ''
continue
self.report({'INFO'}, "Object IDs back to normal")
return{'FINISHED'}
def ui_object_id_duplis(self, context):
if context.active_object.dupli_group:
split = self.layout.split()
row = split.row(align=True)
row.enabled = context.active_object.pass_index != 0
row.operator(
AMTH_OBJECT_OT_id_dupligroup.bl_idname)
row.operator(
AMTH_OBJECT_OT_id_dupligroup_clear.bl_idname,
icon="X", text="")
split.separator()
if AMTH_OBJECT_OT_id_dupligroup.clear:
self.layout.label(text="Next time you save/reload this file, "
"object IDs will be back to normal",
icon="INFO")
# // FEATURE: Object ID for objects inside DupliGroups
# UI: Warning about Z not connected when using EXR
def ui_render_output_z(self, context):
scene = bpy.context.scene
image = scene.render.image_settings
if scene.render.use_compositing and \
image.file_format == 'OPEN_EXR' and \
image.use_zbuffer:
if scene.node_tree and scene.node_tree.nodes:
for no in scene.node_tree.nodes:
if no.type == 'COMPOSITE':
if not no.inputs['Z'].is_linked:
self.layout.label(
text="The Z output in node \"%s\" is not connected" %
no.name, icon="ERROR")
# // UI: Warning about Z not connected
# FEATURE: Delete Materials not assigned to any verts
class AMTH_OBJECT_OT_material_remove_unassigned(Operator):
'''Remove materials not assigned to any vertex'''
bl_idname = "object.amaranth_object_material_remove_unassigned"
bl_label = "Remove Unassigned Materials"
@classmethod
def poll(cls, context):
return context.active_object.material_slots
def execute(self, context):
act_ob = context.active_object
count = len(act_ob.material_slots)
materials_removed = []
act_ob.active_material_index = 0
for slot in act_ob.material_slots:
count -= 1
bpy.ops.object.mode_set(mode='EDIT')
bpy.ops.mesh.select_all(action='DESELECT')
act_ob.active_material_index = count
bpy.ops.object.material_slot_select()
if act_ob.data.total_vert_sel == 0 or \
(len(act_ob.material_slots) == 1 and not \
act_ob.material_slots[0].material):
materials_removed.append(
"%s" % act_ob.active_material.name if act_ob.active_material else "Empty")
bpy.ops.object.mode_set(mode='OBJECT')
bpy.ops.object.material_slot_remove()
else:
pass
bpy.ops.object.mode_set(mode='EDIT')
bpy.ops.mesh.select_all(action='DESELECT')
bpy.ops.object.mode_set(mode='OBJECT')
if materials_removed:
print("\n* Removed %s Unassigned Materials \n" % len(materials_removed))
count_mr = 0
for mr in materials_removed:
count_mr += 1
print("%0.2d. %s" % (count_mr, materials_removed[count_mr - 1]))
print("\n")
self.report({'INFO'}, "Removed %s Unassigned Materials" %
len(materials_removed))
return{'FINISHED'}
def ui_material_remove_unassigned(self, context):
self.layout.operator(
AMTH_OBJECT_OT_material_remove_unassigned.bl_idname,
icon="X")
# // FEATURE: Delete Materials not assigned to any verts
# FEATURE: Cycles Samples Percentage
class AMTH_RENDER_OT_cycles_samples_percentage_set(Operator):
'''Save the current number of samples per shader as final (gets saved in .blend)'''
bl_idname = "scene.amaranth_cycles_samples_percentage_set"
bl_label = "Set as Render Samples"
def execute(self, context):
cycles = context.scene.cycles
cycles.use_samples_final = True
context.scene['amth_cycles_samples_final'] = [
cycles.diffuse_samples,
cycles.glossy_samples,
cycles.transmission_samples,
cycles.ao_samples,
cycles.mesh_light_samples,
cycles.subsurface_samples,
cycles.volume_samples]
self.report({'INFO'}, "Render Samples Saved")
return{'FINISHED'}
class AMTH_RENDER_OT_cycles_samples_percentage(Operator):
'''Set a percentage of the final render samples'''
bl_idname = "scene.amaranth_cycles_samples_percentage"
bl_label = "Set Render Samples Percentage"
percent = IntProperty(
name="Percentage",
description="Percentage to divide render samples by",
subtype='PERCENTAGE',
default=0)
def execute(self, context):
percent = self.percent
cycles = context.scene.cycles
cycles_samples_final = context.scene['amth_cycles_samples_final']
cycles.use_samples_final = False
if percent == 100:
cycles.use_samples_final = True
cycles.diffuse_samples = int((cycles_samples_final[0] / 100) * percent)
cycles.glossy_samples = int((cycles_samples_final[1] / 100) * percent)
cycles.transmission_samples = int((cycles_samples_final[2] / 100) * percent)
cycles.ao_samples = int((cycles_samples_final[3] / 100) * percent)
cycles.mesh_light_samples = int((cycles_samples_final[4] / 100) * percent)
cycles.subsurface_samples = int((cycles_samples_final[5] / 100) * percent)
cycles.volume_samples = int((cycles_samples_final[6] / 100) * percent)
return{'FINISHED'}
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
# //FEATURE: Cycles Samples Percentage
# FEATURE: Jump forward/backward every N frames
class AMTH_SCREEN_OT_frame_jump(Operator):
'''Jump a number of frames forward/backwards'''
bl_idname = "screen.amaranth_frame_jump"
bl_label = "Jump Frames"
forward = BoolProperty(default=True)
def execute(self, context):
scene = context.scene
preferences = context.user_preferences.addons[__name__].preferences
if self.forward:
scene.frame_current = scene.frame_current + preferences.frames_jump
else:
scene.frame_current = scene.frame_current - preferences.frames_jump
return{'FINISHED'}
def ui_userpreferences_edit(self, context):
preferences = context.user_preferences.addons[__name__].preferences
col = self.layout.column()
split = col.split(percentage=0.21)
split.prop(preferences, "frames_jump",
text="Frames to Jump")
# // FEATURE: Jump forward/backward every N frames
# FEATURE: Set Layers to Render
class AMTH_SCENE_OT_layers_render_save(Operator):
'''Save the current scene layers as those that should be enabled for final renders'''
bl_idname = "scene.amaranth_layers_render_save"
bl_label = "Save as Layers for Render"
def execute(self, context):
which = []
n = -1
for l in context.scene.layers:
n += 1
if l:
which.append(n)
context.scene['amth_layers_for_render'] = which
self.report({'INFO'}, "Layers for Render Saved")
return{'FINISHED'}
class AMTH_SCENE_OT_layers_render_view(Operator):
'''Enable the scene layers that should be active for final renders'''
bl_idname = "scene.amaranth_layers_render_view"
bl_label = "View Layers for Render"
def execute(self, context):
scene = context.scene
layers_render = scene['amth_layers_for_render']
for window in bpy.context.window_manager.windows:
screen = window.screen
for area in screen.areas:
if area.type == 'VIEW_3D':
override = {'window': window, 'screen': screen, 'scene': scene,
'area': area, 'region': area.regions[4],
'blend_data': context.blend_data}
if layers_render:
bpy.ops.view3d.layers(override, nr=layers_render[0]+1, extend=False, toggle=False)
for n in layers_render:
context.scene.layers[n] = True
else:
bpy.ops.view3d.layers(override, nr=1, extend=False, toggle=False)
self.report({'INFO'}, "No layers set for render")
break
return{'FINISHED'}
class AMTH_SCENE_OT_layers_render_set_individual(Operator):
'''Whether this layer should be enabled or not for final renders'''
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
bl_idname = "scene.amaranth_layers_render_set_individual"
bl_label = "Set This Layer for Render"
toggle = BoolProperty()
number = IntProperty()
def execute(self, context):
toggle = self.toggle
number = self.number
new_layers = []
for la in context.scene['amth_layers_for_render']:
new_layers.append(la)
if len(context.scene['amth_layers_for_render']) and number in new_layers:
new_layers.remove(number)
else:
new_layers.append(number)
# Remove Duplicates
new_layers = list(set(new_layers))
context.scene['amth_layers_for_render'] = new_layers
bpy.ops.scene.amaranth_layers_render_view()
return{'FINISHED'}
class AMTH_SCENE_OT_layers_render_clear(Operator):
'''Clear layers for render'''
bl_idname = "scene.amaranth_layers_render_clear"
bl_label = "Clear Layers for Render"
def execute(self, context):
if context.scene.get('amth_layers_for_render'):
context.scene['amth_layers_for_render'] = []
return{'FINISHED'}
def ui_layers_for_render(self, context):
lfr_available = context.scene.get('amth_layers_for_render')
if lfr_available:
lfr = context.scene['amth_layers_for_render']
layout = self.layout
layout.label("Layers for Rendering:")
split = layout.split()
col = split.column(align=True)
row = col.row(align=True)
row.operator(
AMTH_SCENE_OT_layers_render_save.bl_idname,
text="Replace Layers" if lfr_available else "Save Current Layers for Render",
icon="FILE_REFRESH" if lfr_available else 'LAYER_USED')
if lfr_available:
row.operator(
AMTH_SCENE_OT_layers_render_clear.bl_idname,
icon='X', text="")
col = col.column(align=True)
col.enabled = True if lfr_available else False
col.operator(
icon="RESTRICT_VIEW_OFF")
split = split.split()
col = split.column(align=True)
row = col.row(align=True)
for n in range(0,5):
row.operator(
AMTH_SCENE_OT_layers_render_set_individual.bl_idname, text="",
icon='LAYER_ACTIVE' if n in lfr else 'BLANK1').number = n
row = col.row(align=True)
for n in range(10,15):
row.operator(
AMTH_SCENE_OT_layers_render_set_individual.bl_idname, text="",
icon='LAYER_ACTIVE' if n in lfr else 'BLANK1').number = n
split = split.split()
col = split.column(align=True)
row = col.row(align=True)
for n in range(5,10):
row.operator(
AMTH_SCENE_OT_layers_render_set_individual.bl_idname, text="",
icon='LAYER_ACTIVE' if n in lfr else 'BLANK1').number = n
row = col.row(align=True)
for n in range(15,20):
row.operator(
AMTH_SCENE_OT_layers_render_set_individual.bl_idname, text="",
icon='LAYER_ACTIVE' if n in lfr else 'BLANK1').number = n
def ui_layers_for_render_header(self, context):
if context.scene.get('amth_layers_for_render'):
self.layout.operator(
AMTH_SCENE_OT_layers_render_view.bl_idname,
text="", icon="IMGDISPLAY")
# FEATURE: Lighters Corner
class AMTH_LightersCorner(bpy.types.Panel):
"""The Lighters Panel"""
bl_label = "Lighter's Corner"
bl_idname = "AMTH_SCENE_PT_lighters_corner"
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "scene"
@classmethod
def poll(cls, context):
any_lamps = False
for ob in bpy.data.objects:
if ob.type == 'LAMP' or cycles_is_emission(context, ob):
any_lamps = True
else:
pass
return any_lamps
def draw_header(self, context):
layout = self.layout
layout.label(text="", icon="LAMP_SUN")
def draw(self, context):
layout = self.layout
scene = context.scene
objects = bpy.data.objects
ob_act = context.active_object
lamps = bpy.data.lamps
list_meshlights = scene.amaranth_lighterscorner_list_meshlights
layout.prop(scene, "amaranth_lighterscorner_list_meshlights")
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
box = layout.box()
if lamps:
if objects:
row = box.row(align=True)
split = row.split(percentage=0.42)
col = split.column()
col.label(text="Name")
split = split.split(percentage=0.1)
col = split.column()
col.label(text="", icon="BLANK1")
if engine in ['CYCLES', 'BLENDER_RENDER']:
if engine == 'BLENDER_RENDER':
split = split.split(percentage=0.7)
else:
split = split.split(percentage=0.35)
col = split.column()
col.label(text="Samples")
if engine == 'CYCLES':
split = split.split(percentage=0.35)
col = split.column()
col.label(text="Size")
split = split.split(percentage=0.8)
col = split.column()
col.label(text="Visibility")
for ob in objects:
is_lamp = ob.type == 'LAMP'
is_emission = True if cycles_is_emission(context, ob) and list_meshlights else False
if ob and is_lamp or is_emission:
lamp = ob.data
clamp = ob.data.cycles
row = box.row(align=True)
split = row.split(percentage=0.5)
col = split.column()
row = col.row()
row.alignment = 'LEFT'
row.operator(AMTH_SCENE_OT_amaranth_object_select.bl_idname,
text='%s %s%s' % (
" [L] " if ob.library else "",
ob.name,
"" if ob.name in context.scene.objects else " [Not in Scene]"),
icon="%s" % ('LAMP_%s' % ob.data.type if is_lamp else 'MESH_GRID'),
emboss=False).object = ob.name
if ob.library:
row = col.row(align=True)
row.alignment = "LEFT"
row.operator(AMTH_SCENE_OT_blender_instance_open.bl_idname,
text=ob.library.filepath,
icon="LINK_BLEND",
emboss=False).filepath=ob.library.filepath
if engine == 'CYCLES':
split = split.split(percentage=0.35)
col = split.column()
if is_lamp:
if scene.cycles.progressive == 'BRANCHED_PATH':
col.prop(clamp, "samples", text="")
if scene.cycles.progressive == 'PATH':
col.label(text="N/A")
else:
col.label(text="N/A")
if engine == 'BLENDER_RENDER':
split = split.split(percentage=0.7)
col = split.column()
if is_lamp:
if lamp.type == 'HEMI':
col.label(text="Not Available")
elif lamp.type == 'AREA' and lamp.shadow_method == 'RAY_SHADOW':
row = col.row(align=True)
row.prop(lamp, "shadow_ray_samples_x", text="X")
if lamp.shape == 'RECTANGLE':
row.prop(lamp, "shadow_ray_samples_y", text="Y")
elif lamp.shadow_method == 'RAY_SHADOW':
col.prop(lamp, "shadow_ray_samples", text="Ray Samples")
elif lamp.shadow_method == 'BUFFER_SHADOW':
col.prop(lamp, "shadow_buffer_samples", text="Buffer Samples")
else:
col.label(text="No Shadow")
if engine == 'CYCLES':
split = split.split(percentage=0.4)
col = split.column()
if is_lamp:
if lamp.type in ['POINT','SUN', 'SPOT']:
col.label(text="%.2f" % lamp.shadow_soft_size)
elif lamp.type == 'HEMI':
col.label(text="N/A")
elif lamp.type == 'AREA' and lamp.shape == 'RECTANGLE':
col.label(text="%.2fx%.2f" % (lamp.size, lamp.size_y))
else:
col.label(text="%.2f" % lamp.size)
split = split.split(percentage=0.8)
col = split.column()
row = col.row(align=True)
row.prop(ob, "hide", text="", emboss=False)
row.prop(ob, "hide_render", text="", emboss=False)
split = split.split(percentage=0.3)
col = split.column()
col.label(text="", icon="%s" % "TRIA_LEFT" if ob == ob_act else "BLANK1")
else:
box.label(text="No Lamps", icon="LAMP_DATA")
classes = (AMTH_SCENE_MT_color_management_presets,
AMTH_AddPresetColorManagement,
AMTH_SCENE_PT_scene_debug,
AMTH_SCENE_OT_refresh,
AMTH_SCENE_OT_cycles_shader_list_nodes,
AMTH_SCENE_OT_cycles_shader_list_nodes_clear,
AMTH_SCENE_OT_list_missing_node_links,
AMTH_SCENE_OT_list_missing_material_slots,
AMTH_SCENE_OT_list_missing_material_slots_clear,
AMTH_SCENE_OT_blender_instance_open,
AMTH_SCENE_OT_layers_render_set_individual,
AMTH_SCENE_OT_layers_render_clear,
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
AMTH_WM_OT_save_reload,
AMTH_MESH_OT_find_asymmetric,
AMTH_MESH_OT_make_symmetric,
AMTH_NODE_OT_AddTemplateVignette,
AMTH_NODE_MT_amaranth_templates,
AMTH_FILE_OT_directory_current_blend,
AMTH_FILE_OT_directory_go_to,
AMTH_NODE_PT_indices,
AMTH_NODE_PT_simplify,
AMTH_NODE_OT_toggle_mute,
AMTH_NODE_OT_show_active_node_image,
AMTH_VIEW3D_OT_render_border_camera,
AMTH_VIEW3D_OT_show_only_render,
AMTH_OBJECT_OT_select_meshlights,
AMTH_OBJECT_OT_id_dupligroup,
AMTH_OBJECT_OT_id_dupligroup_clear,
AMTH_OBJECT_OT_material_remove_unassigned,
AMTH_POSE_OT_paths_clear_all,
AMTH_POSE_OT_paths_frame_match,
AMTH_RENDER_OT_cycles_samples_percentage,
AMTH_RENDER_OT_cycles_samples_percentage_set,
AMTH_FILE_PT_libraries,
AMTH_SCREEN_OT_frame_jump)
Pablo Vazquez
committed
addon_keymaps = []
def register():
bpy.utils.register_class(AmaranthToolsetPreferences)
# UI: Register the panel
init_properties()
for c in classes:
bpy.utils.register_class(c)
bpy.types.VIEW3D_MT_object_specials.append(button_refresh)
bpy.types.VIEW3D_MT_object_specials.append(button_render_border_camera)
bpy.types.VIEW3D_MT_object_specials.append(button_camera_passepartout)
bpy.types.VIEW3D_MT_object_specials.append(button_frame_current)
bpy.types.VIEW3D_MT_pose_specials.append(button_frame_current)
bpy.types.VIEW3D_MT_select_object.append(button_select_meshlights)
bpy.types.VIEW3D_HT_header.append(ui_layers_for_render_header)
Pablo Vazquez
committed
bpy.types.INFO_MT_file.append(button_save_reload)
bpy.types.INFO_HT_header.append(stats_scene)
bpy.types.TIME_HT_header.append(label_timeline_extra_info)
Pablo Vazquez
committed
bpy.types.NODE_HT_header.append(node_templates_pulldown)
bpy.types.NODE_HT_header.append(node_stats)
bpy.types.NODE_HT_header.append(node_shader_extra)
bpy.types.NODE_PT_active_node_properties.append(ui_node_normal_values)
Pablo Vazquez
committed
bpy.types.CyclesRender_PT_sampling.append(render_cycles_scene_samples)
Pablo Vazquez
committed
bpy.types.FILEBROWSER_HT_header.append(button_directory_current_blend)
bpy.types.SCENE_PT_simplify.append(unsimplify_ui)
bpy.types.CyclesScene_PT_simplify.append(unsimplify_ui)
bpy.types.DATA_PT_display.append(pose_motion_paths_ui)
Pablo Vazquez
committed
bpy.types.RENDER_PT_dimensions.append(render_final_resolution_ui)
bpy.types.RENDER_PT_output.append(ui_render_output_z)
bpy.types.SCENE_PT_color_management.prepend(ui_color_management_presets)
bpy.types.SEQUENCER_HT_header.append(ui_sequencer_extra_info)
bpy.types.OBJECT_PT_duplication.append(ui_dupli_group_library_path)
bpy.types.OBJECT_PT_relations.append(ui_object_id_duplis)
bpy.types.MATERIAL_MT_specials.append(ui_material_remove_unassigned)
bpy.types.USERPREF_PT_edit.append(ui_userpreferences_edit)
bpy.types.RENDERLAYER_PT_layers.append(ui_layers_for_render)
Pablo Vazquez
committed
bpy.app.handlers.render_pre.append(unsimplify_render_pre)
bpy.app.handlers.render_post.append(unsimplify_render_post)
wm = bpy.context.window_manager
kc = wm.keyconfigs.addon
if kc:
km = kc.keymaps.new(name='Node Editor', space_type='NODE_EDITOR')
km.keymap_items.new("node.show_active_node_image", 'ACTIONMOUSE', 'RELEASE')
km.keymap_items.new("node.show_active_node_image", 'SELECTMOUSE', 'RELEASE')
km = kc.keymaps.new(name='Node Editor', space_type='NODE_EDITOR')
kmi = km.keymap_items.new('wm.call_menu', 'W', 'PRESS')
kmi.properties.name = "AMTH_NODE_MT_amaranth_templates"
Pablo Vazquez
committed
km = kc.keymaps.new(name='Window')
kmi = km.keymap_items.new('scene.refresh', 'F5', 'PRESS', shift=False, ctrl=False)
kmi = km.keymap_items.new('wm.save_reload', 'W', 'PRESS', shift=True, ctrl=True)
km = kc.keymaps.new(name='Frames')
kmi = km.keymap_items.new('screen.amaranth_frame_jump', 'UP_ARROW', 'PRESS', shift=True)
kmi.properties.forward = True
kmi = km.keymap_items.new('screen.amaranth_frame_jump', 'DOWN_ARROW', 'PRESS', shift=True)
kmi.properties.forward = False
Pablo Vazquez
committed
km = kc.keymaps.new(name='3D View', space_type='VIEW_3D')
kmi = km.keymap_items.new('view3d.show_only_render', 'Z', 'PRESS', shift=True, alt=True)
km = kc.keymaps.new(name='Graph Editor', space_type='GRAPH_EDITOR')
kmi = km.keymap_items.new('wm.context_set_enum', 'TAB', 'PRESS', ctrl=True)
kmi.properties.data_path = 'area.type'
kmi.properties.value = 'DOPESHEET_EDITOR'
km = kc.keymaps.new(name='Dopesheet', space_type='DOPESHEET_EDITOR')
kmi = km.keymap_items.new('wm.context_set_enum', 'TAB', 'PRESS', ctrl=True)
kmi.properties.data_path = 'area.type'
kmi.properties.value = 'GRAPH_EDITOR'
km = kc.keymaps.new(name='Dopesheet', space_type='DOPESHEET_EDITOR')
kmi = km.keymap_items.new('wm.context_toggle_enum', 'TAB', 'PRESS', shift=True)
kmi.properties.data_path = 'space_data.mode'
kmi.properties.value_1 = 'ACTION'
kmi.properties.value_2 = 'DOPESHEET'
Pablo Vazquez
committed
addon_keymaps.append((km, kmi))
def unregister():
bpy.utils.unregister_class(AmaranthToolsetPreferences)
for c in classes:
bpy.utils.unregister_class(c)
bpy.types.VIEW3D_MT_object_specials.remove(button_refresh)
bpy.types.VIEW3D_MT_object_specials.remove(button_render_border_camera)
bpy.types.VIEW3D_MT_object_specials.remove(button_camera_passepartout)
bpy.types.VIEW3D_MT_object_specials.remove(button_frame_current)
bpy.types.VIEW3D_MT_pose_specials.remove(button_frame_current)
bpy.types.VIEW3D_MT_select_object.remove(button_select_meshlights)
bpy.types.VIEW3D_HT_header.remove(ui_layers_for_render_header)
bpy.types.INFO_MT_file.remove(button_save_reload)
bpy.types.INFO_HT_header.remove(stats_scene)
Pablo Vazquez
committed
bpy.types.TIME_HT_header.remove(label_timeline_extra_info)
bpy.types.NODE_HT_header.remove(node_templates_pulldown)
bpy.types.NODE_HT_header.remove(node_stats)
bpy.types.NODE_HT_header.remove(node_shader_extra)
bpy.types.NODE_PT_active_node_properties.remove(ui_node_normal_values)
Pablo Vazquez
committed
bpy.types.CyclesRender_PT_sampling.remove(render_cycles_scene_samples)
Pablo Vazquez
committed
bpy.types.FILEBROWSER_HT_header.remove(button_directory_current_blend)
bpy.types.SCENE_PT_simplify.remove(unsimplify_ui)
bpy.types.CyclesScene_PT_simplify.remove(unsimplify_ui)
bpy.types.DATA_PT_display.remove(pose_motion_paths_ui)
Pablo Vazquez
committed
bpy.types.RENDER_PT_dimensions.remove(render_final_resolution_ui)
bpy.types.RENDER_PT_output.remove(ui_render_output_z)
bpy.types.SCENE_PT_color_management.remove(ui_color_management_presets)
bpy.types.SEQUENCER_HT_header.remove(ui_sequencer_extra_info)
bpy.types.OBJECT_PT_duplication.remove(ui_dupli_group_library_path)
bpy.types.OBJECT_PT_relations.remove(ui_object_id_duplis)
bpy.types.MATERIAL_MT_specials.remove(ui_material_remove_unassigned)
bpy.types.USERPREF_PT_edit.remove(ui_userpreferences_edit)
bpy.types.RENDERLAYER_PT_layers.remove(ui_layers_for_render)
Pablo Vazquez
committed
bpy.app.handlers.render_pre.remove(unsimplify_render_pre)
bpy.app.handlers.render_post.remove(unsimplify_render_post)
CoDEmanX
committed
Pablo Vazquez
committed
for km, kmi in addon_keymaps:
km.keymap_items.remove(kmi)
addon_keymaps.clear()
Pablo Vazquez
committed
clear_properties()
if __name__ == "__main__":
register()