Demo entry 6729598

cde

   

Submitted by anonymous on Apr 03, 2018 at 09:52
Language: Python. Code size: 1.6 kB.

def startUpFile():

    #bpy.ops.object.mode_set(mode="OBJECT")
    #bpy.ops.object.select_all(action="SELECT")
    #bpy.ops.object.delete()

    """
    # work in progress

    bpy.ops.import_mesh.stl(filepath=WD+"/02_Main/footmodel/footmodelfootModel.stl")
    bpy.context.active_object.name = "footModel"
    bpy.ops.import_mesh.stl(filepath=WD+"/02_Main/footmodel/footmodelmeasure_fflength.stl")
    bpy.context.active_object.name = "measure_fflength"
    bpy.ops.import_mesh.stl(filepath=WD+"/02_Main/footmodel/footmodelmeasure_ffwidth.stl")
    bpy.context.active_object.name = "measure_ffwidth"
    bpy.ops.import_mesh.stl(filepath=WD+"/02_Main/footmodel/footmodelmeasure_heellength.stl")
    bpy.context.active_object.name = "measure_heellength"
    bpy.ops.import_mesh.stl(filepath=WD+"/02_Main/footmodel/footmodelmeasure_heelwidth.stl")
    bpy.context.active_object.name = "measure_heelwidth"
    """

    bpy.ops.object.armature_add()
    bpy.ops.object.mode_set(mode="EDIT")
    bpy.ops.armature.extrude_move(TRANSFORM_OT_translate={"value": (0, 0, 1)})
    bpy.ops.armature.extrude_move(TRANSFORM_OT_translate={"value": (0, 0, 1)})
    bpy.ops.armature.extrude_move(TRANSFORM_OT_translate={"value": (0, 0, 1)})

    bpy.ops.object.mode_set(mode="OBJECT")

    bpy.context.active_object.name = "templateSkeleton"

    namelist = ["tibia", "hindfoot", "forefoot", "hallux"]

    for armature in bpy.data.armatures:
        armature.name = 'Armature'
        for idx, bone in enumerate(armature.bones):
            bone.name = namelist[idx]

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).