diff options
author | meta-androcto <meta.androcto1@gmail.com> | 2019-05-22 02:22:10 +0300 |
---|---|---|
committer | meta-androcto <meta.androcto1@gmail.com> | 2019-05-22 02:22:10 +0300 |
commit | a953af8c9e3ab7ee3fa2fec171a525f5f9b6cedd (patch) | |
tree | 5fcefca96909b7d4636842348b4d3e32b8d7b021 /btrace | |
parent | 07ec645862275ffe2d60e2d6481080aa0ae8b1f0 (diff) |
btrace: initial update for 2.8
Diffstat (limited to 'btrace')
-rw-r--r-- | btrace/__init__.py | 47 | ||||
-rw-r--r-- | btrace/bTrace.py | 199 | ||||
-rw-r--r-- | btrace/bTrace_panel.py | 387 | ||||
-rw-r--r-- | btrace/bTrace_props.py | 391 |
4 files changed, 551 insertions, 473 deletions
diff --git a/btrace/__init__.py b/btrace/__init__.py index fe0c4758..4e200a53 100644 --- a/btrace/__init__.py +++ b/btrace/__init__.py @@ -20,29 +20,30 @@ bl_info = { "name": "Btrace", "author": "liero, crazycourier, Atom, Meta-Androcto, MacKracken", - "version": (1, 2, 1), - "blender": (2, 78, 0), - "location": "View3D > Tools", + "version": (1, 2, 2), + "blender": (2, 80, 0), + "location": "View3D", "description": "Tools for converting/animating objects/particles into curves", - "warning": "", + "warning": "Particle Tracers not working", "wiki_url": "https://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/Curve/Btrace", "category": "Add Curve"} -if "bpy" in locals(): - import importlib - importlib.reload(bTrace_props) - importlib.reload(bTrace) -else: - from . import bTrace_props - from . import bTrace - import bpy + +# if "bpy" in locals(): +# import importlib +# importlib.reload(bTrace_props) +# importlib.reload(bTrace) +# else: +# from . import bTrace_props +# from . import bTrace +from . import bTrace_props +from . import bTrace + from bpy.types import AddonPreferences -from .bTrace_props import ( - TracerProperties, - addTracerObjectPanel, -) -from .bTrace import ( +from . bTrace_props import TracerProperties + +from . bTrace import ( OBJECT_OT_convertcurve, OBJECT_OT_objecttrace, OBJECT_OT_objectconnect, @@ -56,6 +57,8 @@ from .bTrace import ( OBJECT_OT_materialChango, OBJECT_OT_clearColorblender, ) + +from . bTrace_panel import addTracerObjectPanel from bpy.props import ( EnumProperty, PointerProperty, @@ -104,21 +107,21 @@ classes = ( OBJECT_OT_meshfollow, OBJECT_OT_materialChango, OBJECT_OT_clearColorblender, - btrace_preferences, + btrace_preferences ) + +# register, unregister = bpy.utils.register_classes_factory(classes) def register(): for cls in classes: bpy.utils.register_class(cls) bpy.types.WindowManager.curve_tracer = PointerProperty(type=TracerProperties) - def unregister(): for cls in classes: bpy.utils.unregister_class(cls) del bpy.types.WindowManager.curve_tracer - -if __name__ == "__main__": - register() +# if __name__ == "__main__": +# register() diff --git a/btrace/bTrace.py b/btrace/bTrace.py index 9897afcc..f4d64a0c 100644 --- a/btrace/bTrace.py +++ b/btrace/bTrace.py @@ -20,7 +20,7 @@ # Add more options to curve radius/modulation plus cyclic/connect curve option import bpy -import selection_utils +# import selection_utils from bpy.types import Operator from random import ( choice as rand_choice, @@ -29,6 +29,63 @@ from random import ( uniform as rand_uniform, ) +# Selection Module: Contributors: Mackraken, Andrew Hale (TrumanBlending) +# Adapted from Mackraken's "Tools for Curves" addon + + +selected = [] + + +class SelectionOrder(bpy.types.Operator): + """Store the object names in the order they are selected, """ \ + """use RETURN key to confirm selection, ESCAPE key to cancel""" + bl_idname = "object.select_order" + bl_label = "Select with Order" + bl_options = {'UNDO'} + + num_selected = 0 + + @classmethod + def poll(self, context): + return bpy.context.mode == 'OBJECT' + + def update(self, context): + # Get the currently selected objects + sel = context.selected_objects + num = len(sel) + + if num == 0: + # Reset the list + del selected[:] + elif num > self.num_selected: + # Get all the newly selected objects and add + new = [ob.name for ob in sel if ob.name not in selected] + selected.extend(new) + elif num < self.num_selected: + # Get the selected objects and remove from list + curnames = {ob.name for ob in sel} + selected[:] = [name for name in selected if name in curnames] + + # Set the number of currently select objects + self.num_selected = len(selected) + + def modal(self, context, event): + if event.type == 'RET': + # If return is pressed, finish the operator + return {'FINISHED'} + elif event.type == 'ESC': + # If escape is pressed, cancel the operator + return {'CANCELLED'} + + # Update selection if we need to + self.update(context) + return {'PASS_THROUGH'} + + def invoke(self, context, event): + self.update(context) + + context.window_manager.modal_handler_add(self) + return {'RUNNING_MODAL'} def error_handlers(self, op_name, error, reports="ERROR", func=False): if self and reports: @@ -115,9 +172,10 @@ class OBJECT_OT_objectconnect(Operator): if curve_handle == 'AUTOMATIC': # hackish because of naming conflict in api curve_handle = 'AUTO' # Check if Btrace group exists, if not create - bgroup = bpy.data.collections.keys() - if 'Btrace' not in bgroup: - bpy.ops.collections.create(name="Btrace") + bcollection = bpy.data.collections.keys() + if 'Btrace' not in bcollection: + mycol=bpy.data.collections.new(name="Btrace") + bpy.context.scene.collection.children.link(mycol) # check if noise if Btrace.connect_noise: bpy.ops.object.btfcnoise() @@ -181,7 +239,9 @@ class OBJECT_OT_objectconnect(Operator): if Btrace.animate: # Add Curve Grow it? bpy.ops.curve.btgrow() - bpy.ops.object.collection_link(group="Btrace") # add to Btrace group + bpy.data.collections["Btrace"].objects.link(curve) # add to Btrace collection + + # Check if we add grow curve if Btrace.animate: bpy.ops.curve.btgrow() # Add grow curve @@ -213,10 +273,9 @@ def curvetracer(curvename, splinename): tracer.bevel_resolution = Btrace.curve_resolution tracer.bevel_depth = Btrace.curve_depth tracer.resolution_u = Btrace.curve_u - return tracer, curve - +# Particle Trace class OBJECT_OT_particletrace(Operator): bl_idname = "particles.particletrace" bl_label = "Btrace: Particle Trace" @@ -231,9 +290,10 @@ class OBJECT_OT_particletrace(Operator): def execute(self, context): try: - Btrace = context.window_manager.curve_tracer + Btrace = bpy.context.window_manager.curve_tracer particle_step = Btrace.particle_step # step size in frames obj = bpy.context.object + obj = bpy.context.depsgraph.objects.get(ob.name, None) ps = obj.particle_systems.active curvelist = [] curve_handle = Btrace.curve_handle @@ -245,20 +305,24 @@ class OBJECT_OT_particletrace(Operator): curve_handle = 'FREE' # Check if Btrace group exists, if not create - bgroup = bpy.data.collections.keys() - if 'Btrace' not in bgroup: - bpy.ops.collection.create(name="Btrace") + bcollection = bpy.data.collections.keys() + if 'Btrace' not in bcollection: + mycol=bpy.data.collections.new(name="Btrace") + bpy.context.scene.collection.children.link(mycol) if Btrace.curve_join: tracer = curvetracer('Tracer', 'Splines') + for x in ps.particles: if not Btrace.curve_join: tracer = curvetracer('Tracer.000', 'Spline.000') spline = tracer[0].splines.new('BEZIER') + # add point to spline based on step size spline.bezier_points.add((x.lifetime - 1) // particle_step) for t in list(range(int(x.lifetime))): bpy.context.scene.frame_set(t + x.birth_time) + if not t % particle_step: p = spline.bezier_points[t // particle_step] p.co = x.location @@ -266,12 +330,13 @@ class OBJECT_OT_particletrace(Operator): p.handle_left_type = curve_handle particlecurve = tracer[1] curvelist.append(particlecurve) + # add to group bpy.ops.object.select_all(action='DESELECT') for curveobject in curvelist: curveobject.select_set(True) bpy.context.view_layer.objects.active = curveobject - bpy.ops.object.collection_link(group="Btrace") + bpy.data.collections["Btrace"].objects.link(curveobject) # Materials trace_mats = addtracemat(curveobject.data) if not trace_mats and check_materials is True: @@ -310,6 +375,7 @@ class OBJECT_OT_traceallparticles(Operator): def execute(self, context): try: obj = context.object + eval_ob = bpy.context.depsgraph.objects.get(obj.name, None) ps = obj.particle_systems.active setting = ps.settings @@ -336,7 +402,8 @@ class OBJECT_OT_traceallparticles(Operator): # Create new object with settings listed above curve = bpy.data.objects.new('Tracer', tracer) # Link newly created object to the scene - bpy.context.collection.objects.link(curve) + # bpy.context.view_layer.objects.link(curve) + bpy.context.scene.collection.objects.link(curve) # add a new Bezier point in the new curve spline = tracer.splines.new('BEZIER') spline.bezier_points.add(setting.count - 1) @@ -666,11 +733,11 @@ class OBJECT_OT_meshfollow(Operator): followed_item = meshobjs[objindex] if drawmethod == 'VERTS': # find Vert vector - g_co = obj.matrix_local * followed_item.co + g_co = obj.matrix_local @ followed_item.co if drawmethod == 'FACES': # find Face vector - g_co = obj.matrix_local * followed_item.normal + g_co = obj.matrix_local @ followed_item.normal if drawmethod == 'EDGES': v1 = followed_item.vertices[0] @@ -678,7 +745,7 @@ class OBJECT_OT_meshfollow(Operator): co1 = bpy.context.object.data.vertices[v1] co2 = bpy.context.object.data.vertices[v2] localcenter = co1.co.lerp(co2.co, 0.5) - g_co = obj.matrix_world * localcenter + g_co = obj.matrix_world @ localcenter if drawmethod == 'OBJECT': g_co = objindex.location.copy() @@ -696,7 +763,7 @@ class OBJECT_OT_meshfollow(Operator): spline = tracer.splines.new('BEZIER') spline.bezier_points.add(len(co_list) - 1) curve = bpy.data.objects.new('curve', tracer) - scn.objects.link(curve) + scn.collection.objects.link(curve) curvelist.append(curve) # render ready curve tracer.resolution_u = Btrace.curve_u @@ -721,9 +788,10 @@ class OBJECT_OT_meshfollow(Operator): # Run methods # Check if Btrace group exists, if not create - bgroup = bpy.data.collections.keys() - if 'Btrace' not in bgroup: - bpy.ops.collection.create(name="Btrace") + bcollection = bpy.data.collections.keys() + if 'Btrace' not in bcollection: + mycol=bpy.data.collections.new(name="Btrace") + bpy.context.scene.collection.children.link(mycol) Btrace = bpy.context.window_manager.curve_tracer sel = getsel_option() # Get selection @@ -735,15 +803,20 @@ class OBJECT_OT_meshfollow(Operator): curvelist.append(make_curve(vector_list)) else: for i in sel: + print(i) vector_list = get_coord(i) - curvelist.append(make_curve(vector_list)) + make_curve(vector_list) + # curvelist.append(make_curve(vector_list)) # append happens in function # Select new curves and add to group bpy.ops.object.select_all(action='DESELECT') for curveobject in curvelist: if curveobject.type == 'CURVE': curveobject.select_set(True) - context.view_layer.objects.active = curveobject - bpy.ops.object.collection_link(group="Btrace") + bpy.context.view_layer.objects.active = curveobject + + bpy.data.collections["Btrace"].objects.link(curveobject) #2.8 link obj to collection + bpy.context.scene.collection.objects.unlink(curveobject) # unlink from scene collection + # bpy.ops.object.group_link(group="Btrace") # Materials trace_mats = addtracemat(curveobject.data) if not trace_mats and check_materials is True: @@ -779,7 +852,7 @@ def addtracemat(matobj): matslots = bpy.context.object.data.materials.items() if len(matslots) < 1: # Make sure there is only one material slot - engine = bpy.context.scene.render.engine + Btrace = bpy.context.window_manager.curve_tracer # Check if color blender is to be run @@ -836,16 +909,14 @@ def addtracemat(matobj): mat_color = Btrace.trace_mat_color TraceMat = bpy.data.materials.new('TraceMat') - # add cycles or BI render material options - if engine == 'CYCLES': - TraceMat.use_nodes = True - Diffuse_BSDF = TraceMat.node_tree.nodes['Diffuse BSDF'] - r, g, b = mat_color[0], mat_color[1], mat_color[2] - Diffuse_BSDF.inputs[0].default_value = [r, g, b, 1] - TraceMat.diffuse_color = mat_color - else: - TraceMat.diffuse_color = mat_color - TraceMat.specular_intensity = 0.5 + + TraceMat.use_nodes = True + BSDF = TraceMat.node_tree.nodes[1] + r, g, b = mat_color[0], mat_color[1], mat_color[2] + BSDF.inputs[0].default_value = [r, g, b, 1] # change node color + TraceMat.diffuse_color = [r, g, b, 1] # change viewport color + + # Add material to object matobj.materials.append(bpy.data.materials.get(TraceMat.name)) @@ -900,7 +971,7 @@ class OBJECT_OT_materialChango(Operator): theObj = i # Check to see if object has materials checkMaterials = len(theObj.data.materials) - if engine == 'CYCLES': + if engine == 'CYCLES' or engine == 'BLENDER_EEVEE': materialName = "colorblendMaterial" madMat = bpy.data.materials.new(materialName) madMat.use_nodes = True @@ -924,67 +995,67 @@ class OBJECT_OT_materialChango(Operator): # Random material function def colorblenderRandom(): - randomRGB = (rand_random(), rand_random(), rand_random()) - if engine == 'CYCLES': - Diffuse_BSDF = madMat.node_tree.nodes['Diffuse BSDF'] + randomRGB = (rand_random(), rand_random(), rand_random(), 1) + if engine == 'CYCLES' or engine == 'BLENDER_EEVEE': + Principled_BSDF = madMat.node_tree.nodes[1] mat_color = randomRGB r, g, b = mat_color[0], mat_color[1], mat_color[2] - Diffuse_BSDF.inputs[0].default_value = [r, g, b, 1] - madMat.diffuse_color = mat_color + Principled_BSDF.inputs[0].default_value = [r, g, b, 1] + madMat.diffuse_color = mat_color[0], mat_color[1], mat_color[2], 1 else: madMat.diffuse_color = randomRGB def colorblenderCustom(): - if engine == 'CYCLES': - Diffuse_BSDF = madMat.node_tree.nodes['Diffuse BSDF'] + if engine == 'CYCLES' or engine == 'BLENDER_EEVEE': + Principled_BSDF = madMat.node_tree.nodes[1] mat_color = rand_choice(customColors) r, g, b = mat_color[0], mat_color[1], mat_color[2] - Diffuse_BSDF.inputs[0].default_value = [r, g, b, 1] - madMat.diffuse_color = mat_color + Principled_BSDF.inputs[0].default_value = [r, g, b, 1] + madMat.diffuse_color = mat_color[0], mat_color[1], mat_color[2], 1 else: madMat.diffuse_color = rand_choice(customColors) # Black and white color def colorblenderBW(): - if engine == 'CYCLES': - Diffuse_BSDF = madMat.node_tree.nodes['Diffuse BSDF'] + if engine == 'CYCLES' or engine == 'BLENDER_EEVEE': + Principled_BSDF = madMat.node_tree.nodes[1] mat_color = rand_choice(bwColors) r, g, b = mat_color[0], mat_color[1], mat_color[2] - Diffuse_BSDF.inputs[0].default_value = [r, g, b, 1] - madMat.diffuse_color = mat_color + Principled_BSDF.inputs[0].default_value = [r, g, b, 1] + madMat.diffuse_color = mat_color[0], mat_color[1], mat_color[2], 1 else: madMat.diffuse_color = rand_choice(bwColors) # Bright colors def colorblenderBright(): - if engine == 'CYCLES': - Diffuse_BSDF = madMat.node_tree.nodes['Diffuse BSDF'] + if engine == 'CYCLES' or engine == 'BLENDER_EEVEE': + Principled_BSDF = madMat.node_tree.nodes[1] mat_color = rand_choice(brightColors) r, g, b = mat_color[0], mat_color[1], mat_color[2] - Diffuse_BSDF.inputs[0].default_value = [r, g, b, 1] - madMat.diffuse_color = mat_color + Principled_BSDF.inputs[0].default_value = [r, g, b, 1] + madMat.diffuse_color = mat_color[0], mat_color[1], mat_color[2], 1 else: madMat.diffuse_color = rand_choice(brightColors) # Earth Tones def colorblenderEarth(): - if engine == 'CYCLES': - Diffuse_BSDF = madMat.node_tree.nodes['Diffuse BSDF'] + if engine == 'CYCLES' or engine == 'BLENDER_EEVEE': + Principled_BSDF = madMat.node_tree.nodes[1] mat_color = rand_choice(earthColors) r, g, b = mat_color[0], mat_color[1], mat_color[2] - Diffuse_BSDF.inputs[0].default_value = [r, g, b, 1] - madMat.diffuse_color = mat_color + Principled_BSDF.inputs[0].default_value = [r, g, b, 1] + madMat.diffuse_color = mat_color[0], mat_color[1], mat_color[2], 1 else: madMat.diffuse_color = rand_choice(earthColors) # Green to Blue Tones def colorblenderGreenBlue(): - if engine == 'CYCLES': - Diffuse_BSDF = madMat.node_tree.nodes['Diffuse BSDF'] + if engine == 'CYCLES' or engine == 'BLENDER_EEVEE': + Principled_BSDF = madMat.node_tree.nodes[1] mat_color = rand_choice(greenblueColors) r, g, b = mat_color[0], mat_color[1], mat_color[2] - Diffuse_BSDF.inputs[0].default_value = [r, g, b, 1] - madMat.diffuse_color = mat_color + Principled_BSDF.inputs[0].default_value = [r, g, b, 1] + madMat.diffuse_color = mat_color[0], mat_color[1], mat_color[2], 1 else: madMat.diffuse_color = rand_choice(greenblueColors) @@ -1014,9 +1085,9 @@ class OBJECT_OT_materialChango(Operator): pass # Add keyframe to material - if engine == 'CYCLES': + if engine == 'CYCLES' or engine == 'BLENDER_EEVEE': madMat.node_tree.nodes[ - 'Diffuse BSDF'].inputs[0].keyframe_insert('default_value') + 1].inputs[0].keyframe_insert('default_value') # not sure if this is need, it's viewport color only madMat.keyframe_insert('diffuse_color') else: @@ -1061,9 +1132,9 @@ class OBJECT_OT_clearColorblender(Operator): while start <= (end + 100): context.scene.frame_set(frame=start) try: - if engine == 'CYCLES': + if engine == 'CYCLES' or engine == 'BLENDER_EEVEE': matCl.node_tree.nodes[ - 'Diffuse BSDF'].inputs[0].keyframe_delete('default_value') + 1].inputs[0].keyframe_delete('default_value') elif engine == 'BLENDER_RENDER': matCl.keyframe_delete('diffuse_color') except: diff --git a/btrace/bTrace_panel.py b/btrace/bTrace_panel.py new file mode 100644 index 00000000..c36d24f1 --- /dev/null +++ b/btrace/bTrace_panel.py @@ -0,0 +1,387 @@ +import bpy +from bpy.types import Panel + +# Draw Brush panel in Toolbar +class addTracerObjectPanel(Panel): + bl_idname = "BTRACE_PT_object_brush" + bl_label = "Btrace" + bl_space_type = "VIEW_3D" + bl_region_type = "UI" + bl_context = "objectmode" + bl_category = "Create" + bl_options = {'DEFAULT_CLOSED'} + + def draw(self, context): + layout = self.layout + Btrace = context.window_manager.curve_tracer + addon_prefs = context.preferences.addons[__package__].preferences + switch_expand = addon_prefs.expand_enum + obj = context.object + + # Color Blender Panel options + def color_blender(): + # Buttons for Color Blender + row = box.row() + row.label(text="Color palette") + row.prop(Btrace, "mmColors", text="") + + # Show Custom Colors if selected + if Btrace.mmColors == 'CUSTOM': + row = box.row(align=True) + for i in range(1, 9): + row.prop(Btrace, "mmColor" + str(i), text="") + # Show Earth Colors + elif Btrace.mmColors == 'BW': + row = box.row(align=True) + row.prop(Btrace, "bwColor1", text="") + row.prop(Btrace, "bwColor2", text="") + # Show Earth Colors + elif Btrace.mmColors == 'BRIGHT': + row = box.row(align=True) + for i in range(1, 5): + row.prop(Btrace, "brightColor" + str(i), text="") + # Show Earth Colors + elif Btrace.mmColors == 'EARTH': + row = box.row(align=True) + for i in range(1, 6): + row.prop(Btrace, "earthColor" + str(i), text="") + # Show Earth Colors + elif Btrace.mmColors == 'GREENBLUE': + row = box.row(align=True) + for i in range(1, 4): + row.prop(Btrace, "greenblueColor" + str(i), text="") + elif Btrace.mmColors == 'RANDOM': + row = box.row() + + # Curve noise settings + def curve_noise(): + row = box.row() + row.label(text="F-Curve Noise", icon='RNDCURVE') + row = box.row(align=True) + row.prop(Btrace, "fcnoise_rot", toggle=True) + row.prop(Btrace, "fcnoise_loc", toggle=True) + row.prop(Btrace, "fcnoise_scale", toggle=True) + + col = box.column(align=True) + col.prop(Btrace, "fcnoise_amp") + col.prop(Btrace, "fcnoise_timescale") + box.prop(Btrace, "fcnoise_key") + + # Curve Panel options + def curve_settings(): + # Button for curve options + row = self.layout.row() + row = box.row(align=True) + + row.prop(Btrace, "show_curve_settings", + icon='CURVE_BEZCURVE', text="Curve Settings") + row.prop(Btrace, "material_settings", + icon='MATERIAL_DATA', text="Material Settings") + + if Btrace.material_settings: + row = box.row() + row.label(text="Material Settings", icon='COLOR') + row = box.row() + row.prop(Btrace, "trace_mat_random") + if not Btrace.trace_mat_random: + row = box.row() + row.prop(Btrace, "trace_mat_color", text="") + else: + row.prop(Btrace, "mat_run_color_blender") + if Btrace.mat_run_color_blender: + row = box.row() + row.operator("object.colorblenderclear", + text="Reset Material Keyframes", + icon="KEY_DEHLT") + row.prop(Btrace, "mmSkip", text="Keyframe every") + color_blender() + row = box.row() + + if Btrace.show_curve_settings: + # selected curve options + if len(context.selected_objects) > 0 and obj.type == 'CURVE': + col = box.column(align=True) + col.label(text="Edit Curves for:", icon='IPO_BEZIER') + col.separator() + col.label(text="Selected Curve Bevel Options") + row = col.row(align=True) + row.prop(obj.data, "bevel_depth", text="Depth") + row.prop(obj.data, "bevel_resolution", text="Resolution") + row = col.row(align=True) + row.prop(obj.data, "resolution_u") + else: # For new curve + box.label(text="New Curve Settings", icon='CURVE_BEZCURVE') + box.prop(Btrace, "curve_spline") + box.prop(Btrace, "curve_handle") + box.label(text="Bevel Options") + col = box.column(align=True) + row = col.row(align=True) + row.prop(Btrace, "curve_depth", text="Depth") + row.prop(Btrace, "curve_resolution", text="Resolution") + row = col.row(align=True) + row.prop(Btrace, "curve_u") + + # Grow Animation Panel options + def add_grow(): + # Button for grow animation option + row = box.row() + row.label(text="Animate Final Curve", icon="NONE") + row = box.row() + row.prop(Btrace, "animate", text="Add Grow Curve Animation", icon="META_BALL") + box.separator() + if Btrace.animate: + box.label(text="Frame Animation Settings:", icon="META_BALL") + col = box.column(align=True) + col.prop(Btrace, "anim_auto") + if not Btrace.anim_auto: + row = col.row(align=True) + row.prop(Btrace, "anim_f_start") + row.prop(Btrace, "anim_length") + row = col.row(align=True) + row.prop(Btrace, "anim_delay") + row.prop(Btrace, "anim_f_fade") + + box.label(text="Additional Settings") + row = box.row() + row.prop(Btrace, "anim_tails") + row.prop(Btrace, "anim_keepr") + + # Start Btrace Panel + if switch_expand == 'list': + layout.label(text="Available Tools:", icon="COLLAPSEMENU") + col = layout.column(align=True) + col.prop(Btrace, "btrace_toolmenu", text="") + elif switch_expand == 'col': + col = layout.column(align=True) + col.prop(Btrace, "btrace_toolmenu", expand=True) + elif switch_expand == 'row': + row = layout.row(align=True) + row.alignment = 'CENTER' + row.prop(Btrace, "btrace_toolmenu", text="", expand=True) + + # Start Object Tools + sel = context.selected_objects + + # Default option (can be expanded into help) + if Btrace.btrace_toolmenu == 'tool_help': + row = layout.row() + row.label(text="Pick an option", icon="HELP") + + # Object Trace + elif Btrace.btrace_toolmenu == 'tool_objectTrace': + row = layout.row() + row.label(text=" Trace Tool:", icon="FORCE_CURVE") + box = self.layout.box() + row = box.row() + row.label(text="Object Trace", icon="FORCE_MAGNETIC") + row.operator("object.btobjecttrace", text="Run!", icon="PLAY") + row = box.row() + row.prop(Btrace, "settings_toggle", icon="MODIFIER", text="Settings") + myselected = "Selected %d" % len(context.selected_objects) + row.label(text=myselected) + if Btrace.settings_toggle: + box.label(text="Edge Type for Curves:", icon="IPO_CONSTANT") + row = box.row(align=True) + row.prop(Btrace, "convert_edgetype", text="") + box.prop(Btrace, "object_duplicate") + if len(sel) > 1: + box.prop(Btrace, "convert_joinbefore") + else: + Btrace.convert_joinbefore = False + row = box.row() + row.prop(Btrace, "distort_curve") + if Btrace.distort_curve: + col = box.column(align=True) + col.prop(Btrace, "distort_modscale") + col.prop(Btrace, "distort_noise") + row = box.row() + curve_settings() # Show Curve/material settings + add_grow() # Grow settings here + + # Objects Connect + elif Btrace.btrace_toolmenu == 'tool_objectsConnect': + row = layout.row() + row.label(text=" Trace Tool:", icon="FORCE_CURVE") + box = self.layout.box() + row = box.row() + row.label(text="Objects Connect", icon="OUTLINER_OB_EMPTY") + row.operator("object.btobjectsconnect", text="Run!", icon="PLAY") + row = box.row() + row.prop(Btrace, "settings_toggle", icon='MODIFIER', text='Settings') + row.label(text="") + if Btrace.settings_toggle: + row = box.row() + row.prop(Btrace, "respect_order", text="Selection Options") + if Btrace.respect_order: + box.operator("object.select_order", + text="Click to start order selection", + icon='UV_SYNC_SELECT') + row = box.row() + row.prop(Btrace, "connect_noise", text="Add F-Curve Noise") + if Btrace.connect_noise: + curve_noise() # Show Curve Noise settings + + curve_settings() # Show Curve/material settings + add_grow() # Grow settings here + + # Mesh Follow + elif Btrace.btrace_toolmenu == 'tool_meshFollow': + row = layout.row() + row.label(text=" Trace Tool:", icon="FORCE_CURVE") + box = self.layout.box() + row = box.row() + row.label(text="Mesh Follow", icon="DRIVER") + row.operator("object.btmeshfollow", text="Run!", icon="PLAY") + row = box.row() + if Btrace.fol_mesh_type == 'OBJECT': + a, b = "Trace Object", "SNAP_VOLUME" + if Btrace.fol_mesh_type == 'VERTS': + a, b = "Trace Verts", "SNAP_VERTEX" + if Btrace.fol_mesh_type == 'EDGES': + a, b = "Trace Edges", "SNAP_EDGE" + if Btrace.fol_mesh_type == 'FACES': + a, b = "Trace Faces", "SNAP_FACE" + row.prop(Btrace, "settings_toggle", icon='MODIFIER', text='Settings') + row.label(text=a, icon=b) + if Btrace.settings_toggle: + col = box.column(align=True) + row = col.row(align=True) + row.prop(Btrace, "fol_mesh_type", expand=True) + row = col.row(align=True) + if Btrace.fol_mesh_type != 'OBJECT': + row.prop(Btrace, "fol_sel_option", expand=True) + row = box.row() + if Btrace.fol_sel_option == 'RANDOM': + row.label(text="Random Select of Total") + row.prop(Btrace, "fol_perc_verts", text="%") + if Btrace.fol_sel_option == 'CUSTOM': + row.label(text="Choose selection in Edit Mode") + if Btrace.fol_sel_option == 'ALL': + row.label(text="Select All items") + col = box.column(align=True) + col.label(text="Time Options", icon="TIME") + col.prop(Btrace, "particle_step") + row = col.row(align=True) + row.prop(Btrace, "fol_start_frame") + row.prop(Btrace, "fol_end_frame") + curve_settings() # Show Curve/material settings + add_grow() # Grow settings here + + # Handwriting Tools + elif Btrace.btrace_toolmenu == 'tool_handwrite': + row = layout.row() + row.label(text=" Trace Tool:", icon="FORCE_CURVE") + box = self.layout.box() + row = box.row() + row.label(text='Handwriting', icon='BRUSH_DATA') + row.operator("curve.btwriting", text="Run!", icon='PLAY') + row = box.row() + row = box.row() + row.label(text='Grease Pencil Writing Tools') + col = box.column(align=True) + row = col.row(align=True) + row.operator("gpencil.draw", text="Draw", icon='BRUSH_DATA').mode = 'DRAW' + row.operator("gpencil.draw", text="Poly", icon='VPAINT_HLT').mode = 'DRAW_POLY' + row = col.row(align=True) + row.operator("gpencil.draw", text="Line", icon='ZOOM_OUT').mode = 'DRAW_STRAIGHT' + row.operator("gpencil.draw", text="Erase", icon='TPAINT_HLT').mode = 'ERASER' + row = box.row() + row.operator("gpencil.data_unlink", text="Delete Grease Pencil Layer", icon="CANCEL") + row = box.row() + curve_settings() # Show Curve/material settings + add_grow() # Grow settings here + + # Particle Trace + elif Btrace.btrace_toolmenu == 'tool_particleTrace': + row = layout.row() + row.label(text=" Trace Tool:", icon="FORCE_CURVE") + box = self.layout.box() + row = box.row() + row.label(text="Particle Trace", icon="PARTICLES") + row.operator("particles.particletrace", text="Run!", icon="PLAY") + row = box.row() + row.prop(Btrace, "settings_toggle", icon='MODIFIER', text='Settings') + row.label(text="") + if Btrace.settings_toggle: + box.prop(Btrace, "particle_step") + row = box.row() + row.prop(Btrace, "curve_join") + curve_settings() # Show Curve/material settings + add_grow() # Grow settings here + + # Connect Particles + elif Btrace.btrace_toolmenu == 'tool_particleConnect': + row = layout.row() + row.label(text=" Trace Tool:", icon="FORCE_CURVE") + box = self.layout.box() + row = box.row() + row.label(text='Particle Connect', icon='MOD_PARTICLES') + row.operator("particles.connect", icon="PLAY", text='Run!') + row = box.row() + row.prop(Btrace, "settings_toggle", icon='MODIFIER', text='Settings') + row.label(text="") + if Btrace.settings_toggle: + box.prop(Btrace, "particle_step") + row = box.row() + row.prop(Btrace, 'particle_auto') + if not Btrace.particle_auto: + row = box.row(align=True) + row.prop(Btrace, 'particle_f_start') + row.prop(Btrace, 'particle_f_end') + curve_settings() # Show Curve/material settings + add_grow() # Grow settings here + + # Grow Animation + elif Btrace.btrace_toolmenu == 'tool_growCurve': + row = layout.row() + row.label(text=" Curve Tool:", icon="OUTLINER_OB_CURVE") + box = self.layout.box() + row = box.row() + row.label(text="Grow Curve", icon="META_BALL") + row.operator("curve.btgrow", text="Run!", icon="PLAY") + row = box.row() + row.prop(Btrace, "settings_toggle", icon="MODIFIER", text="Settings") + row.operator("object.btreset", icon="KEY_DEHLT") + if Btrace.settings_toggle: + box.label(text="Frame Animation Settings:") + col = box.column(align=True) + col.prop(Btrace, "anim_auto") + if not Btrace.anim_auto: + row = col.row(align=True) + row.prop(Btrace, "anim_f_start") + row.prop(Btrace, "anim_length") + row = col.row(align=True) + row.prop(Btrace, "anim_delay") + row.prop(Btrace, "anim_f_fade") + + box.label(text="Additional Settings") + row = box.row() + row.prop(Btrace, "anim_tails") + row.prop(Btrace, "anim_keepr") + + # F-Curve Noise Curve + elif Btrace.btrace_toolmenu == 'tool_fcurve': + row = layout.row() + row.label(text=" Curve Tool:", icon="OUTLINER_OB_CURVE") + box = self.layout.box() + row = box.row() + row.label(text="F-Curve Noise", icon='RNDCURVE') + row.operator("object.btfcnoise", icon='PLAY', text="Run!") + row = box.row() + row.prop(Btrace, "settings_toggle", icon='MODIFIER', text='Settings') + row.operator("object.btreset", icon='KEY_DEHLT') + if Btrace.settings_toggle: + curve_noise() + + # Color Blender + elif Btrace.btrace_toolmenu == 'tool_colorblender': + row = layout.row() + row.label(text=" Curve/Object Tool:", icon="OUTLINER_OB_CURVE") + box = self.layout.box() + row = box.row() + row.label(text="Color Blender", icon="COLOR") + row.operator("object.colorblender", icon='PLAY', text="Run!") + row = box.row() + row.operator("object.colorblenderclear", text="Reset Keyframes", icon="KEY_DEHLT") + row.prop(Btrace, "mmSkip", text="Keyframe every") + color_blender() diff --git a/btrace/bTrace_props.py b/btrace/bTrace_props.py index 3f0fed74..4476e0f6 100644 --- a/btrace/bTrace_props.py +++ b/btrace/bTrace_props.py @@ -537,7 +537,7 @@ class TracerProperties(PropertyGroup): # Toolbar show/hide booleans for tool options btrace_menu_items = [ - ('tool_help', "Help", + ('tool_help', "Choose Tool", "Pick one of the options below", "INFO", 0), ('tool_objectTrace', "Object Trace", "Trace selected mesh object with a curve", "FORCE_MAGNETIC", 1), @@ -545,8 +545,8 @@ class TracerProperties(PropertyGroup): "Connect objects with a curve controlled by hooks", "OUTLINER_OB_EMPTY", 2), ('tool_meshFollow', "Mesh Follow", "Follow selection items on animated mesh object", "DRIVER", 3), - ('tool_handwrite', "Handwriting", - "Create and Animate curve using the grease pencil", "BRUSH_DATA", 4), + # ('tool_handwrite', "Handwriting", + # "Create and Animate curve using the grease pencil", "BRUSH_DATA", 4), ('tool_particleTrace', "Particle Trace", "Trace particle path with a curve", "PARTICLES", 5), ('tool_particleConnect', "Particle Connect", @@ -558,6 +558,7 @@ class TracerProperties(PropertyGroup): ('tool_colorblender', "Color Blender", "Pick the color of the created curves", "COLOR", 9), ] + btrace_toolmenu: EnumProperty( name="Tools", items=btrace_menu_items, @@ -566,387 +567,3 @@ class TracerProperties(PropertyGroup): ) -# Draw Brush panel in Toolbar -class addTracerObjectPanel(Panel): - bl_idname = "BTRACE_PT_object_brush" - bl_label = "Btrace" - bl_space_type = "VIEW_3D" - bl_region_type = "TOOLS" - bl_context = "objectmode" - bl_category = "Create" - bl_options = {'DEFAULT_CLOSED'} - - def draw(self, context): - layout = self.layout - Btrace = context.window_manager.curve_tracer - addon_prefs = context.preferences.addons["btrace"].preferences - switch_expand = addon_prefs.expand_enum - obj = context.object - - # Color Blender Panel options - def color_blender(): - # Buttons for Color Blender - row = box.row() - row.label(text="Color palette") - row.prop(Btrace, "mmColors", text="") - - # Show Custom Colors if selected - if Btrace.mmColors == 'CUSTOM': - row = box.row(align=True) - for i in range(1, 9): - row.prop(Btrace, "mmColor" + str(i), text="") - # Show Earth Colors - elif Btrace.mmColors == 'BW': - row = box.row(align=True) - row.prop(Btrace, "bwColor1", text="") - row.prop(Btrace, "bwColor2", text="") - # Show Earth Colors - elif Btrace.mmColors == 'BRIGHT': - row = box.row(align=True) - for i in range(1, 5): - row.prop(Btrace, "brightColor" + str(i), text="") - # Show Earth Colors - elif Btrace.mmColors == 'EARTH': - row = box.row(align=True) - for i in range(1, 6): - row.prop(Btrace, "earthColor" + str(i), text="") - # Show Earth Colors - elif Btrace.mmColors == 'GREENBLUE': - row = box.row(align=True) - for i in range(1, 4): - row.prop(Btrace, "greenblueColor" + str(i), text="") - elif Btrace.mmColors == 'RANDOM': - row = box.row() - - # Curve noise settings - def curve_noise(): - row = box.row() - row.label(text="F-Curve Noise", icon='RNDCURVE') - row = box.row(align=True) - row.prop(Btrace, "fcnoise_rot", toggle=True) - row.prop(Btrace, "fcnoise_loc", toggle=True) - row.prop(Btrace, "fcnoise_scale", toggle=True) - - col = box.column(align=True) - col.prop(Btrace, "fcnoise_amp") - col.prop(Btrace, "fcnoise_timescale") - box.prop(Btrace, "fcnoise_key") - - # Curve Panel options - def curve_settings(): - # Button for curve options - row = self.layout.row() - row = box.row(align=True) - - row.prop(Btrace, "show_curve_settings", - icon='CURVE_BEZCURVE', text="Curve Settings") - row.prop(Btrace, "material_settings", - icon='MATERIAL_DATA', text="Material Settings") - - if Btrace.material_settings: - row = box.row() - row.label(text="Material Settings", icon='COLOR') - row = box.row() - row.prop(Btrace, "trace_mat_random") - if not Btrace.trace_mat_random: - row = box.row() - row.prop(Btrace, "trace_mat_color", text="") - else: - row.prop(Btrace, "mat_run_color_blender") - if Btrace.mat_run_color_blender: - row = box.row() - row.operator("object.colorblenderclear", - text="Reset Material Keyframes", - icon="KEY_DEHLT") - row.prop(Btrace, "mmSkip", text="Keyframe every") - color_blender() - row = box.row() - - if Btrace.show_curve_settings: - # selected curve options - if len(context.selected_objects) > 0 and obj.type == 'CURVE': - col = box.column(align=True) - col.label(text="Edit Curves for:", icon='IPO_BEZIER') - col.separator() - col.label(text="Selected Curve Bevel Options") - row = col.row(align=True) - row.prop(obj.data, "bevel_depth", text="Depth") - row.prop(obj.data, "bevel_resolution", text="Resolution") - row = col.row(align=True) - row.prop(obj.data, "resolution_u") - else: # For new curve - box.label(text="New Curve Settings", icon='CURVE_BEZCURVE') - box.prop(Btrace, "curve_spline") - box.prop(Btrace, "curve_handle") - box.label(text="Bevel Options") - col = box.column(align=True) - row = col.row(align=True) - row.prop(Btrace, "curve_depth", text="Depth") - row.prop(Btrace, "curve_resolution", text="Resolution") - row = col.row(align=True) - row.prop(Btrace, "curve_u") - - # Grow Animation Panel options - def add_grow(): - # Button for grow animation option - row = box.row() - row.label(text="Animate Final Curve", icon="SPACE2") - row = box.row() - row.prop(Btrace, "animate", text="Add Grow Curve Animation", icon="META_BALL") - box.separator() - if Btrace.animate: - box.label(text="Frame Animation Settings:", icon="META_BALL") - col = box.column(align=True) - col.prop(Btrace, "anim_auto") - if not Btrace.anim_auto: - row = col.row(align=True) - row.prop(Btrace, "anim_f_start") - row.prop(Btrace, "anim_length") - row = col.row(align=True) - row.prop(Btrace, "anim_delay") - row.prop(Btrace, "anim_f_fade") - - box.label(text="Additional Settings") - row = box.row() - row.prop(Btrace, "anim_tails") - row.prop(Btrace, "anim_keepr") - - # Start Btrace Panel - if switch_expand == 'list': - layout.label(text="Available Tools:", icon="COLLAPSEMENU") - col = layout.column(align=True) - col.prop(Btrace, "btrace_toolmenu", text="") - elif switch_expand == 'col': - col = layout.column(align=True) - col.prop(Btrace, "btrace_toolmenu", expand=True) - elif switch_expand == 'row': - row = layout.row(align=True) - row.alignment = 'CENTER' - row.prop(Btrace, "btrace_toolmenu", text="", expand=True) - - # Start Object Tools - sel = context.selected_objects - - # Default option (can be expanded into help) - if Btrace.btrace_toolmenu == 'tool_help': - row = layout.row() - row.label(text="Pick an option", icon="HELP") - - # Object Trace - elif Btrace.btrace_toolmenu == 'tool_objectTrace': - row = layout.row() - row.label(text=" Trace Tool:", icon="FORCE_CURVE") - box = self.layout.box() - row = box.row() - row.label(text="Object Trace", icon="FORCE_MAGNETIC") - row.operator("object.btobjecttrace", text="Run!", icon="PLAY") - row = box.row() - row.prop(Btrace, "settings_toggle", icon="MODIFIER", text="Settings") - myselected = "Selected %d" % len(context.selected_objects) - row.label(text=myselected) - if Btrace.settings_toggle: - box.label(text="Edge Type for Curves:", icon="IPO_CONSTANT") - row = box.row(align=True) - row.prop(Btrace, "convert_edgetype", text="") - box.prop(Btrace, "object_duplicate") - if len(sel) > 1: - box.prop(Btrace, "convert_joinbefore") - else: - Btrace.convert_joinbefore = False - row = box.row() - row.prop(Btrace, "distort_curve") - if Btrace.distort_curve: - col = box.column(align=True) - col.prop(Btrace, "distort_modscale") - col.prop(Btrace, "distort_noise") - row = box.row() - curve_settings() # Show Curve/material settings - add_grow() # Grow settings here - - # Objects Connect - elif Btrace.btrace_toolmenu == 'tool_objectsConnect': - row = layout.row() - row.label(text=" Trace Tool:", icon="FORCE_CURVE") - box = self.layout.box() - row = box.row() - row.label(text="Objects Connect", icon="OUTLINER_OB_EMPTY") - row.operator("object.btobjectsconnect", text="Run!", icon="PLAY") - row = box.row() - row.prop(Btrace, "settings_toggle", icon='MODIFIER', text='Settings') - row.label(text="") - if Btrace.settings_toggle: - row = box.row() - row.prop(Btrace, "respect_order", text="Selection Options") - if Btrace.respect_order: - box.operator("object.select_order", - text="Click to start order selection", - icon='UV_SYNC_SELECT') - row = box.row() - row.prop(Btrace, "connect_noise", text="Add F-Curve Noise") - if Btrace.connect_noise: - curve_noise() # Show Curve Noise settings - - curve_settings() # Show Curve/material settings - add_grow() # Grow settings here - - # Mesh Follow - elif Btrace.btrace_toolmenu == 'tool_meshFollow': - row = layout.row() - row.label(text=" Trace Tool:", icon="FORCE_CURVE") - box = self.layout.box() - row = box.row() - row.label(text="Mesh Follow", icon="DRIVER") - row.operator("object.btmeshfollow", text="Run!", icon="PLAY") - row = box.row() - if Btrace.fol_mesh_type == 'OBJECT': - a, b = "Trace Object", "SNAP_VOLUME" - if Btrace.fol_mesh_type == 'VERTS': - a, b = "Trace Verts", "SNAP_VERTEX" - if Btrace.fol_mesh_type == 'EDGES': - a, b = "Trace Edges", "SNAP_EDGE" - if Btrace.fol_mesh_type == 'FACES': - a, b = "Trace Faces", "SNAP_FACE" - row.prop(Btrace, "settings_toggle", icon='MODIFIER', text='Settings') - row.label(text=a, icon=b) - if Btrace.settings_toggle: - col = box.column(align=True) - row = col.row(align=True) - row.prop(Btrace, "fol_mesh_type", expand=True) - row = col.row(align=True) - if Btrace.fol_mesh_type != 'OBJECT': - row.prop(Btrace, "fol_sel_option", expand=True) - row = box.row() - if Btrace.fol_sel_option == 'RANDOM': - row.label(text="Random Select of Total") - row.prop(Btrace, "fol_perc_verts", text="%") - if Btrace.fol_sel_option == 'CUSTOM': - row.label(text="Choose selection in Edit Mode") - if Btrace.fol_sel_option == 'ALL': - row.label(text="Select All items") - col = box.column(align=True) - col.label(text="Time Options", icon="TIME") - col.prop(Btrace, "particle_step") - row = col.row(align=True) - row.prop(Btrace, "fol_start_frame") - row.prop(Btrace, "fol_end_frame") - curve_settings() # Show Curve/material settings - add_grow() # Grow settings here - - # Handwriting Tools - elif Btrace.btrace_toolmenu == 'tool_handwrite': - row = layout.row() - row.label(text=" Trace Tool:", icon="FORCE_CURVE") - box = self.layout.box() - row = box.row() - row.label(text='Handwriting', icon='BRUSH_DATA') - row.operator("curve.btwriting", text="Run!", icon='PLAY') - row = box.row() - row = box.row() - row.label(text='Grease Pencil Writing Tools') - col = box.column(align=True) - row = col.row(align=True) - row.operator("gpencil.draw", text="Draw", icon='BRUSH_DATA').mode = 'DRAW' - row.operator("gpencil.draw", text="Poly", icon='VPAINT_HLT').mode = 'DRAW_POLY' - row = col.row(align=True) - row.operator("gpencil.draw", text="Line", icon='ZOOMOUT').mode = 'DRAW_STRAIGHT' - row.operator("gpencil.draw", text="Erase", icon='TPAINT_HLT').mode = 'ERASER' - row = box.row() - row.operator("gpencil.data_unlink", text="Delete Grease Pencil Layer", icon="CANCEL") - row = box.row() - curve_settings() # Show Curve/material settings - add_grow() # Grow settings here - - # Particle Trace - elif Btrace.btrace_toolmenu == 'tool_particleTrace': - row = layout.row() - row.label(text=" Trace Tool:", icon="FORCE_CURVE") - box = self.layout.box() - row = box.row() - row.label(text="Particle Trace", icon="PARTICLES") - row.operator("particles.particletrace", text="Run!", icon="PLAY") - row = box.row() - row.prop(Btrace, "settings_toggle", icon='MODIFIER', text='Settings') - row.label(text="") - if Btrace.settings_toggle: - box.prop(Btrace, "particle_step") - row = box.row() - row.prop(Btrace, "curve_join") - curve_settings() # Show Curve/material settings - add_grow() # Grow settings here - - # Connect Particles - elif Btrace.btrace_toolmenu == 'tool_particleConnect': - row = layout.row() - row.label(text=" Trace Tool:", icon="FORCE_CURVE") - box = self.layout.box() - row = box.row() - row.label(text='Particle Connect', icon='MOD_PARTICLES') - row.operator("particles.connect", icon="PLAY", text='Run!') - row = box.row() - row.prop(Btrace, "settings_toggle", icon='MODIFIER', text='Settings') - row.label(text="") - if Btrace.settings_toggle: - box.prop(Btrace, "particle_step") - row = box.row() - row.prop(Btrace, 'particle_auto') - if not Btrace.particle_auto: - row = box.row(align=True) - row.prop(Btrace, 'particle_f_start') - row.prop(Btrace, 'particle_f_end') - curve_settings() # Show Curve/material settings - add_grow() # Grow settings here - - # Grow Animation - elif Btrace.btrace_toolmenu == 'tool_growCurve': - row = layout.row() - row.label(text=" Curve Tool:", icon="OUTLINER_OB_CURVE") - box = self.layout.box() - row = box.row() - row.label(text="Grow Curve", icon="META_BALL") - row.operator("curve.btgrow", text="Run!", icon="PLAY") - row = box.row() - row.prop(Btrace, "settings_toggle", icon="MODIFIER", text="Settings") - row.operator("object.btreset", icon="KEY_DEHLT") - if Btrace.settings_toggle: - box.label(text="Frame Animation Settings:") - col = box.column(align=True) - col.prop(Btrace, "anim_auto") - if not Btrace.anim_auto: - row = col.row(align=True) - row.prop(Btrace, "anim_f_start") - row.prop(Btrace, "anim_length") - row = col.row(align=True) - row.prop(Btrace, "anim_delay") - row.prop(Btrace, "anim_f_fade") - - box.label(text="Additional Settings") - row = box.row() - row.prop(Btrace, "anim_tails") - row.prop(Btrace, "anim_keepr") - - # F-Curve Noise Curve - elif Btrace.btrace_toolmenu == 'tool_fcurve': - row = layout.row() - row.label(text=" Curve Tool:", icon="OUTLINER_OB_CURVE") - box = self.layout.box() - row = box.row() - row.label(text="F-Curve Noise", icon='RNDCURVE') - row.operator("object.btfcnoise", icon='PLAY', text="Run!") - row = box.row() - row.prop(Btrace, "settings_toggle", icon='MODIFIER', text='Settings') - row.operator("object.btreset", icon='KEY_DEHLT') - if Btrace.settings_toggle: - curve_noise() - - # Color Blender - elif Btrace.btrace_toolmenu == 'tool_colorblender': - row = layout.row() - row.label(text=" Curve/Object Tool:", icon="OUTLINER_OB_CURVE") - box = self.layout.box() - row = box.row() - row.label(text="Color Blender", icon="COLOR") - row.operator("object.colorblender", icon='PLAY', text="Run!") - row = box.row() - row.operator("object.colorblenderclear", text="Reset Keyframes", icon="KEY_DEHLT") - row.prop(Btrace, "mmSkip", text="Keyframe every") - color_blender() |