diff --git a/models/cow + mooshroom.blend b/models/cow+mooshroom.blend similarity index 55% rename from models/cow + mooshroom.blend rename to models/cow+mooshroom.blend index a8c6da2..c38bcda 100644 Binary files a/models/cow + mooshroom.blend and b/models/cow+mooshroom.blend differ diff --git a/models/cow + mooshroom_baby.blend b/models/cow+mooshroom_baby.blend similarity index 55% rename from models/cow + mooshroom_baby.blend rename to models/cow+mooshroom_baby.blend index a216080..e83eb18 100644 Binary files a/models/cow + mooshroom_baby.blend and b/models/cow+mooshroom_baby.blend differ diff --git a/models/drowned.blend b/models/drowned.blend index 439a9d2..e9b4f20 100644 Binary files a/models/drowned.blend and b/models/drowned.blend differ diff --git a/models/enderman.blend b/models/enderman.blend index 62e8607..7e62cb9 100644 Binary files a/models/enderman.blend and b/models/enderman.blend differ diff --git a/models/extra/blender-scripting/+/cow.py b/models/extra/blender-scripting/+/cow.py new file mode 100644 index 0000000..d399847 --- /dev/null +++ b/models/extra/blender-scripting/+/cow.py @@ -0,0 +1,62 @@ +import bpy +import os + +#put object as active +bpy.context.scene.objects.active = bpy.data.objects["mooshroom1"] + +#https://docs.blender.org/api/2.79b/bpy.ops.object.html?highlight=object#bpy.ops.object.select_pattern +#Select objects matching a naming pattern +bpy.ops.object.select_pattern(pattern="mooshroom*", case_sensitive=False, extend=True) + +# delete selected +bpy.ops.object.delete(use_global=False) + +bpy.context.scene.objects.active = bpy.data.objects["cow_body"] + +# select everything +bpy.ops.object.select_all(action='TOGGLE') + +# join them together ctrl+j +bpy.ops.object.join() + +# ctrl+shift+alt+c set origin to 3d cursor +bpy.ops.object.origin_set(type='ORIGIN_CURSOR') + +bpy.context.scene.objects.active = bpy.data.objects["cow_body"] + +def get_override(area_type, region_type): + for area in bpy.context.screen.areas: + if area.type == area_type: + for region in area.regions: + if region.type == region_type: + override = {'area': area, 'region': region} + return override + #error message if the area or region wasn't found + raise RuntimeError("Wasn't able to find", region_type," in area ", area_type, + "\n Make sure it's open while executing script.") + + +#we need to override the context of our operator +override = get_override( 'VIEW_3D', 'WINDOW' ) +#rotate about the X-axis by 45 degrees +bpy.ops.transform.rotate(override, axis=(0,0,1)) +bpy.ops.transform.rotate(override, axis=(0,0,1)) + +blend_file_path = bpy.data.filepath +directory = os.path.dirname(blend_file_path) +#target_file = os.path.join(directory, 'agent.obj') +#target_file = os.path.join(directory, 'exported/agent.b3d') +target_file = os.path.join(directory, 'cow.b3d') +target_file_new = os.path.join(directory, 'cow+mooshroom.blend1') + +#bpy.ops.export_scene.obj(filepath=target_file) +bpy.ops.screen.b3d_export(filepath=target_file) + +#bpy.ops.export_scene.obj() +#bpy.ops.screen.b3d_export() + +#save as for testing +bpy.ops.wm.save_as_mainfile(filepath=target_file_new) + +# exits blender +bpy.ops.wm.quit_blender() diff --git a/models/extra/blender-scripting/+/cow_baby.py b/models/extra/blender-scripting/+/cow_baby.py new file mode 100644 index 0000000..ace946e --- /dev/null +++ b/models/extra/blender-scripting/+/cow_baby.py @@ -0,0 +1,62 @@ +import bpy +import os + +#put object as active +bpy.context.scene.objects.active = bpy.data.objects["mooshroom1"] + +#https://docs.blender.org/api/2.79b/bpy.ops.object.html?highlight=object#bpy.ops.object.select_pattern +#Select objects matching a naming pattern +bpy.ops.object.select_pattern(pattern="mooshroom*", case_sensitive=False, extend=True) + +# delete selected +bpy.ops.object.delete(use_global=False) + +bpy.context.scene.objects.active = bpy.data.objects["cow_body"] + +# select everything +bpy.ops.object.select_all(action='TOGGLE') + +# join them together ctrl+j +bpy.ops.object.join() + +# ctrl+shift+alt+c set origin to 3d cursor +bpy.ops.object.origin_set(type='ORIGIN_CURSOR') + +bpy.context.scene.objects.active = bpy.data.objects["cow_body"] + +def get_override(area_type, region_type): + for area in bpy.context.screen.areas: + if area.type == area_type: + for region in area.regions: + if region.type == region_type: + override = {'area': area, 'region': region} + return override + #error message if the area or region wasn't found + raise RuntimeError("Wasn't able to find", region_type," in area ", area_type, + "\n Make sure it's open while executing script.") + + +#we need to override the context of our operator +override = get_override( 'VIEW_3D', 'WINDOW' ) +#rotate about the X-axis by 45 degrees +bpy.ops.transform.rotate(override, axis=(0,0,1)) +bpy.ops.transform.rotate(override, axis=(0,0,1)) + +blend_file_path = bpy.data.filepath +directory = os.path.dirname(blend_file_path) +#target_file = os.path.join(directory, 'agent.obj') +#target_file = os.path.join(directory, 'exported/agent.b3d') +target_file = os.path.join(directory, 'cow_baby.b3d') +target_file_new = os.path.join(directory, 'cow+mooshroom.blend1') + +#bpy.ops.export_scene.obj(filepath=target_file) +bpy.ops.screen.b3d_export(filepath=target_file) + +#bpy.ops.export_scene.obj() +#bpy.ops.screen.b3d_export() + +#save as for testing +bpy.ops.wm.save_as_mainfile(filepath=target_file_new) + +# exits blender +bpy.ops.wm.quit_blender() diff --git a/models/extra/blender-scripting/+/drowned.py b/models/extra/blender-scripting/+/drowned.py new file mode 100644 index 0000000..a6bb1cc --- /dev/null +++ b/models/extra/blender-scripting/+/drowned.py @@ -0,0 +1,94 @@ +import bpy +import os + +#bpy.ops.object.select_all(action='DESELECT') + +#put object as active +bpy.context.scene.objects.active = bpy.data.objects["baby_overlay_head.overlay.1"] + +#https://docs.blender.org/api/2.79b/bpy.ops.object.html?highlight=object#bpy.ops.object.select_pattern +#Select objects matching a naming pattern +bpy.ops.object.select_pattern(pattern="baby_overlay_head.overlay*", case_sensitive=False, extend=True) + +# join them together ctrl+j +bpy.ops.object.join() + +bpy.ops.object.select_all(action='DESELECT') + +#put object as active +bpy.context.scene.objects.active = bpy.data.objects["drowned_body"] + +#https://docs.blender.org/api/2.79b/bpy.ops.object.html?highlight=object#bpy.ops.object.select_pattern +#Select objects matching a naming pattern +bpy.ops.object.select_pattern(pattern="drowned*", case_sensitive=False, extend=True) + +# join them together ctrl+j +bpy.ops.object.join() + +bpy.ops.object.select_all(action='DESELECT') + +#put object as active +bpy.context.scene.objects.active = bpy.data.objects["overlay_body.overlay.1"] + +#https://docs.blender.org/api/2.79b/bpy.ops.object.html?highlight=object#bpy.ops.object.select_pattern +#Select objects matching a naming pattern +bpy.ops.object.select_pattern(pattern="overlay*", case_sensitive=False, extend=True) + +# join them together ctrl+j +bpy.ops.object.join() + +bpy.ops.object.select_all(action='DESELECT') + +#put object as active +bpy.context.scene.objects.active = bpy.data.objects["trident_handle"] + +#https://docs.blender.org/api/2.79b/bpy.ops.object.html?highlight=object#bpy.ops.object.select_pattern +#Select objects matching a naming pattern +bpy.ops.object.select_pattern(pattern="trident*", case_sensitive=False, extend=True) + +# join them together ctrl+j +bpy.ops.object.join() + +#bpy.ops.object.select_all(action='TOGGLE') +bpy.ops.object.select_all(action='SELECT') + +# ctrl+shift+alt+c set origin to 3d cursor +bpy.ops.object.origin_set(type='ORIGIN_CURSOR') + + +def get_override(area_type, region_type): + for area in bpy.context.screen.areas: + if area.type == area_type: + for region in area.regions: + if region.type == region_type: + override = {'area': area, 'region': region} + return override + #error message if the area or region wasn't found + raise RuntimeError("Wasn't able to find", region_type," in area ", area_type, + "\n Make sure it's open while executing script.") + + +#we need to override the context of our operator +override = get_override( 'VIEW_3D', 'WINDOW' ) +#rotate about the X-axis by 45 degrees +bpy.ops.transform.rotate(override, axis=(0,0,1)) +bpy.ops.transform.rotate(override, axis=(0,0,1)) + +blend_file_path = bpy.data.filepath +directory = os.path.dirname(blend_file_path) +#target_file = os.path.join(directory, 'agent.obj') +#target_file = os.path.join(directory, 'exported/agent.b3d') +target_file = os.path.join(directory, 'drowned.b3d') +target_file_new = os.path.join(directory, 'drowned.blend1') + +#bpy.ops.export_scene.obj(filepath=target_file) +bpy.ops.screen.b3d_export(filepath=target_file) + +#bpy.ops.export_scene.obj() +#bpy.ops.screen.b3d_export() + +#save as for testing +bpy.ops.wm.save_as_mainfile(filepath=target_file_new) + +# exits blender +bpy.ops.wm.quit_blender() diff --git a/models/extra/blender-scripting/+/enderman.py b/models/extra/blender-scripting/+/enderman.py new file mode 100644 index 0000000..a1f1872 --- /dev/null +++ b/models/extra/blender-scripting/+/enderman.py @@ -0,0 +1,82 @@ +import bpy +import os + +#bpy.ops.object.select_all(action='DESELECT') + +#put object as active +bpy.context.scene.objects.active = bpy.data.objects["45flower_front"] + +#https://docs.blender.org/api/2.79b/bpy.ops.object.html?highlight=object#bpy.ops.object.select_pattern +#Select objects matching a naming pattern +bpy.ops.object.select_pattern(pattern="45flower*", case_sensitive=False, extend=True) + +# join them together ctrl+j +bpy.ops.object.join() + +bpy.ops.object.select_all(action='DESELECT') + +#put object as active +bpy.context.scene.objects.active = bpy.data.objects["90flower_front"] + +#https://docs.blender.org/api/2.79b/bpy.ops.object.html?highlight=object#bpy.ops.object.select_pattern +#Select objects matching a naming pattern +bpy.ops.object.select_pattern(pattern="90flower*", case_sensitive=False, extend=True) + +# join them together ctrl+j +bpy.ops.object.join() + +bpy.ops.object.select_all(action='DESELECT') + +#put object as active +bpy.context.scene.objects.active = bpy.data.objects["end_body3"] + +#https://docs.blender.org/api/2.79b/bpy.ops.object.html?highlight=object#bpy.ops.object.select_pattern +#Select objects matching a naming pattern +bpy.ops.object.select_pattern(pattern="end_*", case_sensitive=False, extend=True) + +# join them together ctrl+j +bpy.ops.object.join() + +#bpy.ops.object.select_all(action='TOGGLE') +bpy.ops.object.select_all(action='SELECT') + +# ctrl+shift+alt+c set origin to 3d cursor +bpy.ops.object.origin_set(type='ORIGIN_CURSOR') + + +def get_override(area_type, region_type): + for area in bpy.context.screen.areas: + if area.type == area_type: + for region in area.regions: + if region.type == region_type: + override = {'area': area, 'region': region} + return override + #error message if the area or region wasn't found + raise RuntimeError("Wasn't able to find", region_type," in area ", area_type, + "\n Make sure it's open while executing script.") + + +#we need to override the context of our operator +override = get_override( 'VIEW_3D', 'WINDOW' ) +#rotate about the X-axis by 45 degrees +bpy.ops.transform.rotate(override, axis=(0,0,1)) +bpy.ops.transform.rotate(override, axis=(0,0,1)) + +blend_file_path = bpy.data.filepath +directory = os.path.dirname(blend_file_path) +#target_file = os.path.join(directory, 'agent.obj') +#target_file = os.path.join(directory, 'exported/agent.b3d') +target_file = os.path.join(directory, 'enderman.b3d') +target_file_new = os.path.join(directory, 'enderman.blend1') + +#bpy.ops.export_scene.obj(filepath=target_file) +bpy.ops.screen.b3d_export(filepath=target_file) + +#bpy.ops.export_scene.obj() +#bpy.ops.screen.b3d_export() + +#save as for testing +bpy.ops.wm.save_as_mainfile(filepath=target_file_new) + +# exits blender +bpy.ops.wm.quit_blender() diff --git a/models/extra/blender-scripting/+/horse.py b/models/extra/blender-scripting/+/horse.py new file mode 100644 index 0000000..164d938 --- /dev/null +++ b/models/extra/blender-scripting/+/horse.py @@ -0,0 +1,82 @@ +import bpy +import os + +#bpy.ops.object.select_all(action='DESELECT') + +#put object as active +bpy.context.scene.objects.active = bpy.data.objects["chest_left"] + +#https://docs.blender.org/api/2.79b/bpy.ops.object.html?highlight=object#bpy.ops.object.select_pattern +#Select objects matching a naming pattern +bpy.ops.object.select_pattern(pattern="chest_*", case_sensitive=False, extend=True) + +# join them together ctrl+j +bpy.ops.object.join() + +bpy.ops.object.select_all(action='DESELECT') + +#put object as active +bpy.context.scene.objects.active = bpy.data.objects["mule_body1"] + +#https://docs.blender.org/api/2.79b/bpy.ops.object.html?highlight=object#bpy.ops.object.select_pattern +#Select objects matching a naming pattern +bpy.ops.object.select_pattern(pattern="mule_*", case_sensitive=False, extend=True) + +# join them together ctrl+j +bpy.ops.object.join() + +bpy.ops.object.select_all(action='DESELECT') + +#put object as active +bpy.context.scene.objects.active = bpy.data.objects["saddle_top"] + +#https://docs.blender.org/api/2.79b/bpy.ops.object.html?highlight=object#bpy.ops.object.select_pattern +#Select objects matching a naming pattern +bpy.ops.object.select_pattern(pattern="saddle_*", case_sensitive=False, extend=True) + +# join them together ctrl+j +bpy.ops.object.join() + +#bpy.ops.object.select_all(action='TOGGLE') +bpy.ops.object.select_all(action='SELECT') + +# ctrl+shift+alt+c set origin to 3d cursor +bpy.ops.object.origin_set(type='ORIGIN_CURSOR') + + +def get_override(area_type, region_type): + for area in bpy.context.screen.areas: + if area.type == area_type: + for region in area.regions: + if region.type == region_type: + override = {'area': area, 'region': region} + return override + #error message if the area or region wasn't found + raise RuntimeError("Wasn't able to find", region_type," in area ", area_type, + "\n Make sure it's open while executing script.") + + +#we need to override the context of our operator +override = get_override( 'VIEW_3D', 'WINDOW' ) +#rotate about the X-axis by 45 degrees +bpy.ops.transform.rotate(override, axis=(0,0,1)) +bpy.ops.transform.rotate(override, axis=(0,0,1)) + +blend_file_path = bpy.data.filepath +directory = os.path.dirname(blend_file_path) +#target_file = os.path.join(directory, 'agent.obj') +#target_file = os.path.join(directory, 'exported/agent.b3d') +target_file = os.path.join(directory, 'horse_baby.b3d') +target_file_new = os.path.join(directory, 'horse+zombiehorse+skeltonhorse+mule+donkey_baby.blend1') + +#bpy.ops.export_scene.obj(filepath=target_file) +bpy.ops.screen.b3d_export(filepath=target_file) + +#bpy.ops.export_scene.obj() +#bpy.ops.screen.b3d_export() + +#save as for testing +bpy.ops.wm.save_as_mainfile(filepath=target_file_new) + +# exits blender +bpy.ops.wm.quit_blender() diff --git a/models/extra/blender-scripting/+/horse_baby.py b/models/extra/blender-scripting/+/horse_baby.py new file mode 100644 index 0000000..6121ada --- /dev/null +++ b/models/extra/blender-scripting/+/horse_baby.py @@ -0,0 +1,58 @@ +import bpy +import os + +#bpy.ops.object.select_all(action='DESELECT') + +#put object as active +bpy.context.scene.objects.active = bpy.data.objects["mule_neck1"] + +#https://docs.blender.org/api/2.79b/bpy.ops.object.html?highlight=object#bpy.ops.object.select_pattern +#Select objects matching a naming pattern +bpy.ops.object.select_pattern(pattern="mule_*", case_sensitive=False, extend=True) + +# join them together ctrl+j +bpy.ops.object.join() + +#bpy.ops.object.select_all(action='TOGGLE') +bpy.ops.object.select_all(action='SELECT') + +# ctrl+shift+alt+c set origin to 3d cursor +bpy.ops.object.origin_set(type='ORIGIN_CURSOR') + + +def get_override(area_type, region_type): + for area in bpy.context.screen.areas: + if area.type == area_type: + for region in area.regions: + if region.type == region_type: + override = {'area': area, 'region': region} + return override + #error message if the area or region wasn't found + raise RuntimeError("Wasn't able to find", region_type," in area ", area_type, + "\n Make sure it's open while executing script.") + + +#we need to override the context of our operator +override = get_override( 'VIEW_3D', 'WINDOW' ) +#rotate about the X-axis by 45 degrees +bpy.ops.transform.rotate(override, axis=(0,0,1)) +bpy.ops.transform.rotate(override, axis=(0,0,1)) + +blend_file_path = bpy.data.filepath +directory = os.path.dirname(blend_file_path) +#target_file = os.path.join(directory, 'agent.obj') +#target_file = os.path.join(directory, 'exported/agent.b3d') +target_file = os.path.join(directory, 'horse_baby.b3d') +target_file_new = os.path.join(directory, 'horse+zombiehorse+skeltonhorse+mule+donkey_baby.blend1') + +#bpy.ops.export_scene.obj(filepath=target_file) +bpy.ops.screen.b3d_export(filepath=target_file) + +#bpy.ops.export_scene.obj() +#bpy.ops.screen.b3d_export() + +#save as for testing +bpy.ops.wm.save_as_mainfile(filepath=target_file_new) + +# exits blender +bpy.ops.wm.quit_blender() diff --git a/models/extra/blender-scripting/+/illusioner_mc.py b/models/extra/blender-scripting/+/illusioner_mc.py new file mode 100644 index 0000000..ce72aaa --- /dev/null +++ b/models/extra/blender-scripting/+/illusioner_mc.py @@ -0,0 +1,86 @@ +import bpy +import os + +#put object as active +bpy.context.scene.objects.active = bpy.data.objects["imc_bow"] + +#https://docs.blender.org/api/2.79b/bpy.ops.object.html?highlight=object#bpy.ops.object.select_pattern +#Select objects matching a naming pattern +bpy.ops.object.select_pattern(pattern="imc_iro*", case_sensitive=False, extend=True) +bpy.ops.object.select_pattern(pattern="ipp_iro*", case_sensitive=False, extend=True) +bpy.ops.object.select_pattern(pattern="ipp_bo*", case_sensitive=False, extend=True) + +# delete selected +bpy.ops.object.delete(use_global=False) + +bpy.ops.object.select_all(action='DESELECT') + +#put object as active +bpy.context.scene.objects.active = bpy.data.objects["evo_body"] + +#https://docs.blender.org/api/2.79b/bpy.ops.object.html?highlight=object#bpy.ops.object.select_pattern +#Select objects matching a naming pattern +bpy.ops.object.select_pattern(pattern="evo_*", case_sensitive=False, extend=True) + +# join them together ctrl+j +bpy.ops.object.join() + +bpy.ops.object.select_all(action='DESELECT') + +#put object as active +bpy.context.scene.objects.active = bpy.data.objects["hat_head1"] + +#https://docs.blender.org/api/2.79b/bpy.ops.object.html?highlight=object#bpy.ops.object.select_pattern +#Select objects matching a naming pattern +bpy.ops.object.select_pattern(pattern="hat_*", case_sensitive=False, extend=True) + +# join them together ctrl+j +bpy.ops.object.join() + +#bpy.ops.object.select_all(action='TOGGLE') +bpy.ops.object.select_all(action='SELECT') + +# ctrl+shift+alt+c set origin to 3d cursor +bpy.ops.object.origin_set(type='ORIGIN_CURSOR') + + +def get_override(area_type, region_type): + for area in bpy.context.screen.areas: + if area.type == area_type: + for region in area.regions: + if region.type == region_type: + override = {'area': area, 'region': region} + return override + #error message if the area or region wasn't found + raise RuntimeError("Wasn't able to find", region_type," in area ", area_type, + "\n Make sure it's open while executing script.") + + +#we need to override the context of our operator +override = get_override( 'VIEW_3D', 'WINDOW' ) +#rotate about the X-axis by 45 degrees +bpy.ops.transform.rotate(override, axis=(0,0,1)) +bpy.ops.transform.rotate(override, axis=(0,0,1)) + + + + + +blend_file_path = bpy.data.filepath +directory = os.path.dirname(blend_file_path) +#target_file = os.path.join(directory, 'agent.obj') +#target_file = os.path.join(directory, 'exported/agent.b3d') +target_file = os.path.join(directory, 'illusioner_mc.b3d') +target_file_new = os.path.join(directory, 'vindicator+evoker+illusioner+villager+baby.blend1') + +#bpy.ops.export_scene.obj(filepath=target_file) +bpy.ops.screen.b3d_export(filepath=target_file) + +#bpy.ops.export_scene.obj() +#bpy.ops.screen.b3d_export() + +#save as for testing +bpy.ops.wm.save_as_mainfile(filepath=target_file_new) + +# exits blender +bpy.ops.wm.quit_blender() diff --git a/models/extra/blender-scripting/+/illusioner_pp.py b/models/extra/blender-scripting/+/illusioner_pp.py new file mode 100644 index 0000000..d73ff50 --- /dev/null +++ b/models/extra/blender-scripting/+/illusioner_pp.py @@ -0,0 +1,86 @@ +import bpy +import os + +#put object as active +bpy.context.scene.objects.active = bpy.data.objects["imc_bow"] + +#https://docs.blender.org/api/2.79b/bpy.ops.object.html?highlight=object#bpy.ops.object.select_pattern +#Select objects matching a naming pattern +bpy.ops.object.select_pattern(pattern="imc_iro*", case_sensitive=False, extend=True) +bpy.ops.object.select_pattern(pattern="ipp_iro*", case_sensitive=False, extend=True) +bpy.ops.object.select_pattern(pattern="imc_bo*", case_sensitive=False, extend=True) + +# delete selected +bpy.ops.object.delete(use_global=False) + +bpy.ops.object.select_all(action='DESELECT') + +#put object as active +bpy.context.scene.objects.active = bpy.data.objects["evo_body"] + +#https://docs.blender.org/api/2.79b/bpy.ops.object.html?highlight=object#bpy.ops.object.select_pattern +#Select objects matching a naming pattern +bpy.ops.object.select_pattern(pattern="evo_*", case_sensitive=False, extend=True) + +# join them together ctrl+j +bpy.ops.object.join() + +bpy.ops.object.select_all(action='DESELECT') + +#put object as active +bpy.context.scene.objects.active = bpy.data.objects["hat_head1"] + +#https://docs.blender.org/api/2.79b/bpy.ops.object.html?highlight=object#bpy.ops.object.select_pattern +#Select objects matching a naming pattern +bpy.ops.object.select_pattern(pattern="hat_*", case_sensitive=False, extend=True) + +# join them together ctrl+j +bpy.ops.object.join() + +#bpy.ops.object.select_all(action='TOGGLE') +bpy.ops.object.select_all(action='SELECT') + +# ctrl+shift+alt+c set origin to 3d cursor +bpy.ops.object.origin_set(type='ORIGIN_CURSOR') + + +def get_override(area_type, region_type): + for area in bpy.context.screen.areas: + if area.type == area_type: + for region in area.regions: + if region.type == region_type: + override = {'area': area, 'region': region} + return override + #error message if the area or region wasn't found + raise RuntimeError("Wasn't able to find", region_type," in area ", area_type, + "\n Make sure it's open while executing script.") + + +#we need to override the context of our operator +override = get_override( 'VIEW_3D', 'WINDOW' ) +#rotate about the X-axis by 45 degrees +bpy.ops.transform.rotate(override, axis=(0,0,1)) +bpy.ops.transform.rotate(override, axis=(0,0,1)) + + + + + +blend_file_path = bpy.data.filepath +directory = os.path.dirname(blend_file_path) +#target_file = os.path.join(directory, 'agent.obj') +#target_file = os.path.join(directory, 'exported/agent.b3d') +target_file = os.path.join(directory, 'illusioner_pp.b3d') +target_file_new = os.path.join(directory, 'vindicator+evoker+illusioner+villager+baby.blend1') + +#bpy.ops.export_scene.obj(filepath=target_file) +bpy.ops.screen.b3d_export(filepath=target_file) + +#bpy.ops.export_scene.obj() +#bpy.ops.screen.b3d_export() + +#save as for testing +bpy.ops.wm.save_as_mainfile(filepath=target_file_new) + +# exits blender +bpy.ops.wm.quit_blender() diff --git a/models/extra/blender-scripting/+/llama.py b/models/extra/blender-scripting/+/llama.py new file mode 100644 index 0000000..dfd55ed --- /dev/null +++ b/models/extra/blender-scripting/+/llama.py @@ -0,0 +1,82 @@ +import bpy +import os + +#bpy.ops.object.select_all(action='DESELECT') + +#put object as active +bpy.context.scene.objects.active = bpy.data.objects["chest_left"] + +#https://docs.blender.org/api/2.79b/bpy.ops.object.html?highlight=object#bpy.ops.object.select_pattern +#Select objects matching a naming pattern +bpy.ops.object.select_pattern(pattern="chest_*", case_sensitive=False, extend=True) + +# join them together ctrl+j +bpy.ops.object.join() + +bpy.ops.object.select_all(action='DESELECT') + +#put object as active +bpy.context.scene.objects.active = bpy.data.objects["deco_body1"] + +#https://docs.blender.org/api/2.79b/bpy.ops.object.html?highlight=object#bpy.ops.object.select_pattern +#Select objects matching a naming pattern +bpy.ops.object.select_pattern(pattern="deco_*", case_sensitive=False, extend=True) + +# join them together ctrl+j +bpy.ops.object.join() + +bpy.ops.object.select_all(action='DESELECT') + +#put object as active +bpy.context.scene.objects.active = bpy.data.objects["llama_body"] + +#https://docs.blender.org/api/2.79b/bpy.ops.object.html?highlight=object#bpy.ops.object.select_pattern +#Select objects matching a naming pattern +bpy.ops.object.select_pattern(pattern="llama_*", case_sensitive=False, extend=True) + +# join them together ctrl+j +bpy.ops.object.join() + +#bpy.ops.object.select_all(action='TOGGLE') +bpy.ops.object.select_all(action='SELECT') + +# ctrl+shift+alt+c set origin to 3d cursor +bpy.ops.object.origin_set(type='ORIGIN_CURSOR') + + +def get_override(area_type, region_type): + for area in bpy.context.screen.areas: + if area.type == area_type: + for region in area.regions: + if region.type == region_type: + override = {'area': area, 'region': region} + return override + #error message if the area or region wasn't found + raise RuntimeError("Wasn't able to find", region_type," in area ", area_type, + "\n Make sure it's open while executing script.") + + +#we need to override the context of our operator +override = get_override( 'VIEW_3D', 'WINDOW' ) +#rotate about the X-axis by 45 degrees +bpy.ops.transform.rotate(override, axis=(0,0,1)) +bpy.ops.transform.rotate(override, axis=(0,0,1)) + +blend_file_path = bpy.data.filepath +directory = os.path.dirname(blend_file_path) +#target_file = os.path.join(directory, 'agent.obj') +#target_file = os.path.join(directory, 'exported/agent.b3d') +target_file = os.path.join(directory, 'llama.b3d') +target_file_new = os.path.join(directory, 'llama.blend1') + +#bpy.ops.export_scene.obj(filepath=target_file) +bpy.ops.screen.b3d_export(filepath=target_file) + +#bpy.ops.export_scene.obj() +#bpy.ops.screen.b3d_export() + +#save as for testing +bpy.ops.wm.save_as_mainfile(filepath=target_file_new) + +# exits blender +bpy.ops.wm.quit_blender() diff --git a/models/extra/blender-scripting/+/llama_baby.py b/models/extra/blender-scripting/+/llama_baby.py new file mode 100644 index 0000000..8017e4e --- /dev/null +++ b/models/extra/blender-scripting/+/llama_baby.py @@ -0,0 +1,82 @@ +import bpy +import os + +#bpy.ops.object.select_all(action='DESELECT') + +#put object as active +bpy.context.scene.objects.active = bpy.data.objects["chest_left"] + +#https://docs.blender.org/api/2.79b/bpy.ops.object.html?highlight=object#bpy.ops.object.select_pattern +#Select objects matching a naming pattern +bpy.ops.object.select_pattern(pattern="chest_*", case_sensitive=False, extend=True) + +# join them together ctrl+j +bpy.ops.object.join() + +bpy.ops.object.select_all(action='DESELECT') + +#put object as active +bpy.context.scene.objects.active = bpy.data.objects["deco_body1"] + +#https://docs.blender.org/api/2.79b/bpy.ops.object.html?highlight=object#bpy.ops.object.select_pattern +#Select objects matching a naming pattern +bpy.ops.object.select_pattern(pattern="deco_*", case_sensitive=False, extend=True) + +# join them together ctrl+j +bpy.ops.object.join() + +bpy.ops.object.select_all(action='DESELECT') + +#put object as active +bpy.context.scene.objects.active = bpy.data.objects["llama_body"] + +#https://docs.blender.org/api/2.79b/bpy.ops.object.html?highlight=object#bpy.ops.object.select_pattern +#Select objects matching a naming pattern +bpy.ops.object.select_pattern(pattern="llama_*", case_sensitive=False, extend=True) + +# join them together ctrl+j +bpy.ops.object.join() + +#bpy.ops.object.select_all(action='TOGGLE') +bpy.ops.object.select_all(action='SELECT') + +# ctrl+shift+alt+c set origin to 3d cursor +bpy.ops.object.origin_set(type='ORIGIN_CURSOR') + + +def get_override(area_type, region_type): + for area in bpy.context.screen.areas: + if area.type == area_type: + for region in area.regions: + if region.type == region_type: + override = {'area': area, 'region': region} + return override + #error message if the area or region wasn't found + raise RuntimeError("Wasn't able to find", region_type," in area ", area_type, + "\n Make sure it's open while executing script.") + + +#we need to override the context of our operator +override = get_override( 'VIEW_3D', 'WINDOW' ) +#rotate about the X-axis by 45 degrees +bpy.ops.transform.rotate(override, axis=(0,0,1)) +bpy.ops.transform.rotate(override, axis=(0,0,1)) + +blend_file_path = bpy.data.filepath +directory = os.path.dirname(blend_file_path) +#target_file = os.path.join(directory, 'agent.obj') +#target_file = os.path.join(directory, 'exported/agent.b3d') +target_file = os.path.join(directory, 'llama_baby.b3d') +target_file_new = os.path.join(directory, 'llama_baby.blend1') + +#bpy.ops.export_scene.obj(filepath=target_file) +bpy.ops.screen.b3d_export(filepath=target_file) + +#bpy.ops.export_scene.obj() +#bpy.ops.screen.b3d_export() + +#save as for testing +bpy.ops.wm.save_as_mainfile(filepath=target_file_new) + +# exits blender +bpy.ops.wm.quit_blender() diff --git a/models/extra/blender-scripting/+/mooshroom.py b/models/extra/blender-scripting/+/mooshroom.py new file mode 100644 index 0000000..f92b1d4 --- /dev/null +++ b/models/extra/blender-scripting/+/mooshroom.py @@ -0,0 +1,84 @@ +import bpy +import os + +#bpy.ops.object.select_all(action='DESELECT') + +#put object as active +bpy.context.scene.objects.active = bpy.data.objects["mooshroom1"] + +#https://docs.blender.org/api/2.79b/bpy.ops.object.html?highlight=object#bpy.ops.object.select_pattern +#Select objects matching a naming pattern +bpy.ops.object.select_pattern(pattern="mooshroom*", case_sensitive=False, extend=True) + +# join them together ctrl+j +bpy.ops.object.join() + +# sets object named body to active object there can only be one +#bpy.context.scene.objects.active = bpy.data.objects["cow_head"] +#bpy.context.scene.objects.active = bpy.data.objects["cow_body"] + +#bpy.data.objects['body'].select_set(True) +#bpy.data.objects['head'].select_set(True) + +#https://docs.blender.org/api/2.79b/bpy.ops.object.html?highlight=object#bpy.ops.object.select_by_type +#Select all visible objects that are of a type +#bpy.ops.object.select_by_type(extend=False, type='MESH') + + +bpy.ops.object.select_all(action='DESELECT') + +#bpy.ops.object.select_all(action='INVERT') + +#put object as active +bpy.context.scene.objects.active = bpy.data.objects["cow_head"] + +#https://docs.blender.org/api/2.79b/bpy.ops.object.html?highlight=object#bpy.ops.object.select_pattern +#Select objects matching a naming pattern +bpy.ops.object.select_pattern(pattern="cow*", case_sensitive=False, extend=True) + +# join them together ctrl+j +bpy.ops.object.join() + +#bpy.ops.object.select_all(action='TOGGLE') +bpy.ops.object.select_all(action='SELECT') + +# ctrl+shift+alt+c set origin to 3d cursor +bpy.ops.object.origin_set(type='ORIGIN_CURSOR') + + +def get_override(area_type, region_type): + for area in bpy.context.screen.areas: + if area.type == area_type: + for region in area.regions: + if region.type == region_type: + override = {'area': area, 'region': region} + return override + #error message if the area or region wasn't found + raise RuntimeError("Wasn't able to find", region_type," in area ", area_type, + "\n Make sure it's open while executing script.") + + +#we need to override the context of our operator +override = get_override( 'VIEW_3D', 'WINDOW' ) +#rotate about the X-axis by 45 degrees +bpy.ops.transform.rotate(override, axis=(0,0,1)) +bpy.ops.transform.rotate(override, axis=(0,0,1)) + +blend_file_path = bpy.data.filepath +directory = os.path.dirname(blend_file_path) +#target_file = os.path.join(directory, 'agent.obj') +#target_file = os.path.join(directory, 'exported/agent.b3d') +target_file = os.path.join(directory, 'mooshroom.b3d') +target_file_new = os.path.join(directory, 'cow+mooshroom.blend1') + +#bpy.ops.export_scene.obj(filepath=target_file) +bpy.ops.screen.b3d_export(filepath=target_file) + +#bpy.ops.export_scene.obj() +#bpy.ops.screen.b3d_export() + +#save as for testing +bpy.ops.wm.save_as_mainfile(filepath=target_file_new) + +# exits blender +bpy.ops.wm.quit_blender() diff --git a/models/extra/blender-scripting/+/mooshroom_baby.py b/models/extra/blender-scripting/+/mooshroom_baby.py new file mode 100644 index 0000000..4742b2b --- /dev/null +++ b/models/extra/blender-scripting/+/mooshroom_baby.py @@ -0,0 +1,84 @@ +import bpy +import os + +#bpy.ops.object.select_all(action='DESELECT') + +#put object as active +bpy.context.scene.objects.active = bpy.data.objects["mooshroom1"] + +#https://docs.blender.org/api/2.79b/bpy.ops.object.html?highlight=object#bpy.ops.object.select_pattern +#Select objects matching a naming pattern +bpy.ops.object.select_pattern(pattern="mooshroom*", case_sensitive=False, extend=True) + +# join them together ctrl+j +bpy.ops.object.join() + +# sets object named body to active object there can only be one +#bpy.context.scene.objects.active = bpy.data.objects["cow_head"] +#bpy.context.scene.objects.active = bpy.data.objects["cow_body"] + +#bpy.data.objects['body'].select_set(True) +#bpy.data.objects['head'].select_set(True) + +#https://docs.blender.org/api/2.79b/bpy.ops.object.html?highlight=object#bpy.ops.object.select_by_type +#Select all visible objects that are of a type +#bpy.ops.object.select_by_type(extend=False, type='MESH') + + +bpy.ops.object.select_all(action='DESELECT') + +#bpy.ops.object.select_all(action='INVERT') + +#put object as active +bpy.context.scene.objects.active = bpy.data.objects["cow_head"] + +#https://docs.blender.org/api/2.79b/bpy.ops.object.html?highlight=object#bpy.ops.object.select_pattern +#Select objects matching a naming pattern +bpy.ops.object.select_pattern(pattern="cow*", case_sensitive=False, extend=True) + +# join them together ctrl+j +bpy.ops.object.join() + +#bpy.ops.object.select_all(action='TOGGLE') +bpy.ops.object.select_all(action='SELECT') + +# ctrl+shift+alt+c set origin to 3d cursor +bpy.ops.object.origin_set(type='ORIGIN_CURSOR') + + +def get_override(area_type, region_type): + for area in bpy.context.screen.areas: + if area.type == area_type: + for region in area.regions: + if region.type == region_type: + override = {'area': area, 'region': region} + return override + #error message if the area or region wasn't found + raise RuntimeError("Wasn't able to find", region_type," in area ", area_type, + "\n Make sure it's open while executing script.") + + +#we need to override the context of our operator +override = get_override( 'VIEW_3D', 'WINDOW' ) +#rotate about the X-axis by 45 degrees +bpy.ops.transform.rotate(override, axis=(0,0,1)) +bpy.ops.transform.rotate(override, axis=(0,0,1)) + +blend_file_path = bpy.data.filepath +directory = os.path.dirname(blend_file_path) +#target_file = os.path.join(directory, 'agent.obj') +#target_file = os.path.join(directory, 'exported/agent.b3d') +target_file = os.path.join(directory, 'mooshroom_baby.b3d') +target_file_new = os.path.join(directory, 'cow+mooshroom.blend1') + +#bpy.ops.export_scene.obj(filepath=target_file) +bpy.ops.screen.b3d_export(filepath=target_file) + +#bpy.ops.export_scene.obj() +#bpy.ops.screen.b3d_export() + +#save as for testing +bpy.ops.wm.save_as_mainfile(filepath=target_file_new) + +# exits blender +bpy.ops.wm.quit_blender() diff --git a/models/extra/blender-scripting/+/new_horse.py b/models/extra/blender-scripting/+/new_horse.py new file mode 100644 index 0000000..dce79fd --- /dev/null +++ b/models/extra/blender-scripting/+/new_horse.py @@ -0,0 +1,85 @@ +import bpy +import os + +#bpy.ops.object.select_all(action='DESELECT') + +#put object as active +#bpy.context.scene.objects.active = bpy.data.objects["horse.body"] + +#https://docs.blender.org/api/2.79b/bpy.ops.object.html?highlight=object#bpy.ops.object.select_pattern +#Select objects matching a naming pattern +#bpy.ops.object.select_pattern(pattern="horse_*", case_sensitive=False, extend=True) + +# join them together ctrl+j +#bpy.ops.object.join() + +#bpy.ops.object.select_all(action='DESELECT') + +#put object as active +#bpy.context.scene.objects.active = bpy.data.objects["deco_body1"] + +#https://docs.blender.org/api/2.79b/bpy.ops.object.html?highlight=object#bpy.ops.object.select_pattern +#Select objects matching a naming pattern +#bpy.ops.object.select_pattern(pattern="deco_*", case_sensitive=False, extend=True) + +# join them together ctrl+j +#bpy.ops.object.join() + +#bpy.ops.object.select_all(action='DESELECT') + +#put object as active +#bpy.context.scene.objects.active = bpy.data.objects["llama_body"] + +#https://docs.blender.org/api/2.79b/bpy.ops.object.html?highlight=object#bpy.ops.object.select_pattern +#Select objects matching a naming pattern +#bpy.ops.object.select_pattern(pattern="llama_*", case_sensitive=False, extend=True) + +# join them together ctrl+j +#bpy.ops.object.join() + +#put object as active +bpy.context.scene.objects.active = bpy.data.objects["horse.body"] + +#bpy.ops.object.select_all(action='TOGGLE') +bpy.ops.object.select_all(action='SELECT') + +# ctrl+shift+alt+c set origin to 3d cursor +bpy.ops.object.origin_set(type='ORIGIN_CURSOR') + + +def get_override(area_type, region_type): + for area in bpy.context.screen.areas: + if area.type == area_type: + for region in area.regions: + if region.type == region_type: + override = {'area': area, 'region': region} + return override + #error message if the area or region wasn't found + raise RuntimeError("Wasn't able to find", region_type," in area ", area_type, + "\n Make sure it's open while executing script.") + + +#we need to override the context of our operator +override = get_override( 'VIEW_3D', 'WINDOW' ) +#rotate about the X-axis by 45 degrees +bpy.ops.transform.rotate(override, axis=(0,0,1)) +bpy.ops.transform.rotate(override, axis=(0,0,1)) + +blend_file_path = bpy.data.filepath +directory = os.path.dirname(blend_file_path) +#target_file = os.path.join(directory, 'agent.obj') +#target_file = os.path.join(directory, 'exported/agent.b3d') +target_file = os.path.join(directory, 'new_horse.b3d') +target_file_new = os.path.join(directory, 'new_horse.blend1') + +#bpy.ops.export_scene.obj(filepath=target_file) +bpy.ops.screen.b3d_export(filepath=target_file) + +#bpy.ops.export_scene.obj() +#bpy.ops.screen.b3d_export() + +#save as for testing +bpy.ops.wm.save_as_mainfile(filepath=target_file_new) + +# exits blender +bpy.ops.wm.quit_blender() diff --git a/models/extra/blender-scripting/+/pig.py b/models/extra/blender-scripting/+/pig.py new file mode 100644 index 0000000..bcf6ba5 --- /dev/null +++ b/models/extra/blender-scripting/+/pig.py @@ -0,0 +1,82 @@ +import bpy +import os + +#bpy.ops.object.select_all(action='DESELECT') + +#put object as active +bpy.context.scene.objects.active = bpy.data.objects["baby_head"] + +#https://docs.blender.org/api/2.79b/bpy.ops.object.html?highlight=object#bpy.ops.object.select_pattern +#Select objects matching a naming pattern +bpy.ops.object.select_pattern(pattern="baby_*", case_sensitive=False, extend=True) + +# join them together ctrl+j +bpy.ops.object.join() + +bpy.ops.object.select_all(action='DESELECT') + +#put object as active +bpy.context.scene.objects.active = bpy.data.objects["pig_body"] + +#https://docs.blender.org/api/2.79b/bpy.ops.object.html?highlight=object#bpy.ops.object.select_pattern +#Select objects matching a naming pattern +bpy.ops.object.select_pattern(pattern="pig_*", case_sensitive=False, extend=True) + +# join them together ctrl+j +bpy.ops.object.join() + +bpy.ops.object.select_all(action='DESELECT') + +#put object as active +bpy.context.scene.objects.active = bpy.data.objects["saddle1"] + +#https://docs.blender.org/api/2.79b/bpy.ops.object.html?highlight=object#bpy.ops.object.select_pattern +#Select objects matching a naming pattern +bpy.ops.object.select_pattern(pattern="saddle*", case_sensitive=False, extend=True) + +# join them together ctrl+j +bpy.ops.object.join() + +#bpy.ops.object.select_all(action='TOGGLE') +bpy.ops.object.select_all(action='SELECT') + +# ctrl+shift+alt+c set origin to 3d cursor +bpy.ops.object.origin_set(type='ORIGIN_CURSOR') + + +def get_override(area_type, region_type): + for area in bpy.context.screen.areas: + if area.type == area_type: + for region in area.regions: + if region.type == region_type: + override = {'area': area, 'region': region} + return override + #error message if the area or region wasn't found + raise RuntimeError("Wasn't able to find", region_type," in area ", area_type, + "\n Make sure it's open while executing script.") + + +#we need to override the context of our operator +override = get_override( 'VIEW_3D', 'WINDOW' ) +#rotate about the X-axis by 45 degrees +bpy.ops.transform.rotate(override, axis=(0,0,1)) +bpy.ops.transform.rotate(override, axis=(0,0,1)) + +blend_file_path = bpy.data.filepath +directory = os.path.dirname(blend_file_path) +#target_file = os.path.join(directory, 'agent.obj') +#target_file = os.path.join(directory, 'exported/agent.b3d') +target_file = os.path.join(directory, 'pig.b3d') +target_file_new = os.path.join(directory, 'pig.blend1') + +#bpy.ops.export_scene.obj(filepath=target_file) +bpy.ops.screen.b3d_export(filepath=target_file) + +#bpy.ops.export_scene.obj() +#bpy.ops.screen.b3d_export() + +#save as for testing +bpy.ops.wm.save_as_mainfile(filepath=target_file_new) + +# exits blender +bpy.ops.wm.quit_blender() diff --git a/models/extra/blender-scripting/+/piglin_mc.py b/models/extra/blender-scripting/+/piglin_mc.py new file mode 100644 index 0000000..61e174b --- /dev/null +++ b/models/extra/blender-scripting/+/piglin_mc.py @@ -0,0 +1,74 @@ +import bpy +import os + +#bpy.ops.object.select_all(action='DESELECT') + +#put object as active +bpy.context.scene.objects.active = bpy.data.objects["ipp_gold.sword"] + +#https://docs.blender.org/api/2.79b/bpy.ops.object.html?highlight=object#bpy.ops.object.select_pattern +#Select objects matching a naming pattern +bpy.ops.object.select_pattern(pattern="ipp_gold.sw*", case_sensitive=False, extend=True) + +# delete selected +bpy.ops.object.delete(use_global=False) + +bpy.ops.object.select_all(action='DESELECT') + +#put object as active +bpy.context.scene.objects.active = bpy.data.objects["pig_body"] + +#https://docs.blender.org/api/2.79b/bpy.ops.object.html?highlight=object#bpy.ops.object.select_pattern +#Select objects matching a naming pattern +bpy.ops.object.select_pattern(pattern="pig_*", case_sensitive=False, extend=True) + +# join them together ctrl+j +bpy.ops.object.join() + +#bpy.ops.object.select_all(action='TOGGLE') +bpy.ops.object.select_all(action='SELECT') + +# ctrl+shift+alt+c set origin to 3d cursor +bpy.ops.object.origin_set(type='ORIGIN_CURSOR') + + +def get_override(area_type, region_type): + for area in bpy.context.screen.areas: + if area.type == area_type: + for region in area.regions: + if region.type == region_type: + override = {'area': area, 'region': region} + return override + #error message if the area or region wasn't found + raise RuntimeError("Wasn't able to find", region_type," in area ", area_type, + "\n Make sure it's open while executing script.") + + +#we need to override the context of our operator +override = get_override( 'VIEW_3D', 'WINDOW' ) +#rotate about the X-axis by 45 degrees +bpy.ops.transform.rotate(override, axis=(0,0,1)) +bpy.ops.transform.rotate(override, axis=(0,0,1)) + + + + + +blend_file_path = bpy.data.filepath +directory = os.path.dirname(blend_file_path) +#target_file = os.path.join(directory, 'agent.obj') +#target_file = os.path.join(directory, 'exported/agent.b3d') +target_file = os.path.join(directory, 'piglin_mc.b3d') +target_file_new = os.path.join(directory, 'piglin.blend1') + +#bpy.ops.export_scene.obj(filepath=target_file) +bpy.ops.screen.b3d_export(filepath=target_file) + +#bpy.ops.export_scene.obj() +#bpy.ops.screen.b3d_export() + +#save as for testing +bpy.ops.wm.save_as_mainfile(filepath=target_file_new) + +# exits blender +bpy.ops.wm.quit_blender() diff --git a/models/extra/blender-scripting/+/piglin_pp.py b/models/extra/blender-scripting/+/piglin_pp.py new file mode 100644 index 0000000..cfe951d --- /dev/null +++ b/models/extra/blender-scripting/+/piglin_pp.py @@ -0,0 +1,74 @@ +import bpy +import os + +#bpy.ops.object.select_all(action='DESELECT') + +#put object as active +bpy.context.scene.objects.active = bpy.data.objects["imc_gold.sword"] + +#https://docs.blender.org/api/2.79b/bpy.ops.object.html?highlight=object#bpy.ops.object.select_pattern +#Select objects matching a naming pattern +bpy.ops.object.select_pattern(pattern="imc_gold.sw*", case_sensitive=False, extend=True) + +# delete selected +bpy.ops.object.delete(use_global=False) + +bpy.ops.object.select_all(action='DESELECT') + +#put object as active +bpy.context.scene.objects.active = bpy.data.objects["pig_body"] + +#https://docs.blender.org/api/2.79b/bpy.ops.object.html?highlight=object#bpy.ops.object.select_pattern +#Select objects matching a naming pattern +bpy.ops.object.select_pattern(pattern="pig_*", case_sensitive=False, extend=True) + +# join them together ctrl+j +bpy.ops.object.join() + +#bpy.ops.object.select_all(action='TOGGLE') +bpy.ops.object.select_all(action='SELECT') + +# ctrl+shift+alt+c set origin to 3d cursor +bpy.ops.object.origin_set(type='ORIGIN_CURSOR') + + +def get_override(area_type, region_type): + for area in bpy.context.screen.areas: + if area.type == area_type: + for region in area.regions: + if region.type == region_type: + override = {'area': area, 'region': region} + return override + #error message if the area or region wasn't found + raise RuntimeError("Wasn't able to find", region_type," in area ", area_type, + "\n Make sure it's open while executing script.") + + +#we need to override the context of our operator +override = get_override( 'VIEW_3D', 'WINDOW' ) +#rotate about the X-axis by 45 degrees +bpy.ops.transform.rotate(override, axis=(0,0,1)) +bpy.ops.transform.rotate(override, axis=(0,0,1)) + + + + + +blend_file_path = bpy.data.filepath +directory = os.path.dirname(blend_file_path) +#target_file = os.path.join(directory, 'agent.obj') +#target_file = os.path.join(directory, 'exported/agent.b3d') +target_file = os.path.join(directory, 'piglin_pp.b3d') +target_file_new = os.path.join(directory, 'piglin.blend1') + +#bpy.ops.export_scene.obj(filepath=target_file) +bpy.ops.screen.b3d_export(filepath=target_file) + +#bpy.ops.export_scene.obj() +#bpy.ops.screen.b3d_export() + +#save as for testing +bpy.ops.wm.save_as_mainfile(filepath=target_file_new) + +# exits blender +bpy.ops.wm.quit_blender() diff --git a/models/extra/blender-scripting/+/puffer.fish.py b/models/extra/blender-scripting/+/puffer.fish.py new file mode 100644 index 0000000..19b0e28 --- /dev/null +++ b/models/extra/blender-scripting/+/puffer.fish.py @@ -0,0 +1,82 @@ +import bpy +import os + +#bpy.ops.object.select_all(action='DESELECT') + +#put object as active +bpy.context.scene.objects.active = bpy.data.objects["1puf_body"] + +#https://docs.blender.org/api/2.79b/bpy.ops.object.html?highlight=object#bpy.ops.object.select_pattern +#Select objects matching a naming pattern +bpy.ops.object.select_pattern(pattern="1puf_*", case_sensitive=False, extend=True) + +# join them together ctrl+j +bpy.ops.object.join() + +bpy.ops.object.select_all(action='DESELECT') + +#put object as active +bpy.context.scene.objects.active = bpy.data.objects["2puf_body"] + +#https://docs.blender.org/api/2.79b/bpy.ops.object.html?highlight=object#bpy.ops.object.select_pattern +#Select objects matching a naming pattern +bpy.ops.object.select_pattern(pattern="2puf_*", case_sensitive=False, extend=True) + +# join them together ctrl+j +bpy.ops.object.join() + +bpy.ops.object.select_all(action='DESELECT') + +#put object as active +bpy.context.scene.objects.active = bpy.data.objects["3puf_body"] + +#https://docs.blender.org/api/2.79b/bpy.ops.object.html?highlight=object#bpy.ops.object.select_pattern +#Select objects matching a naming pattern +bpy.ops.object.select_pattern(pattern="3puf_*", case_sensitive=False, extend=True) + +# join them together ctrl+j +bpy.ops.object.join() + +#bpy.ops.object.select_all(action='TOGGLE') +bpy.ops.object.select_all(action='SELECT') + +# ctrl+shift+alt+c set origin to 3d cursor +bpy.ops.object.origin_set(type='ORIGIN_CURSOR') + + +def get_override(area_type, region_type): + for area in bpy.context.screen.areas: + if area.type == area_type: + for region in area.regions: + if region.type == region_type: + override = {'area': area, 'region': region} + return override + #error message if the area or region wasn't found + raise RuntimeError("Wasn't able to find", region_type," in area ", area_type, + "\n Make sure it's open while executing script.") + + +#we need to override the context of our operator +override = get_override( 'VIEW_3D', 'WINDOW' ) +#rotate about the X-axis by 45 degrees +bpy.ops.transform.rotate(override, axis=(0,0,1)) +bpy.ops.transform.rotate(override, axis=(0,0,1)) + +blend_file_path = bpy.data.filepath +directory = os.path.dirname(blend_file_path) +#target_file = os.path.join(directory, 'agent.obj') +#target_file = os.path.join(directory, 'exported/agent.b3d') +target_file = os.path.join(directory, 'puffer.fish.b3d') +target_file_new = os.path.join(directory, 'puffer.fish.blend1') + +#bpy.ops.export_scene.obj(filepath=target_file) +bpy.ops.screen.b3d_export(filepath=target_file) + +#bpy.ops.export_scene.obj() +#bpy.ops.screen.b3d_export() + +#save as for testing +bpy.ops.wm.save_as_mainfile(filepath=target_file_new) + +# exits blender +bpy.ops.wm.quit_blender() diff --git a/models/extra/blender-scripting/+/sheep.py b/models/extra/blender-scripting/+/sheep.py new file mode 100644 index 0000000..df22916 --- /dev/null +++ b/models/extra/blender-scripting/+/sheep.py @@ -0,0 +1,70 @@ +import bpy +import os + +#bpy.ops.object.select_all(action='DESELECT') + +#put object as active +bpy.context.scene.objects.active = bpy.data.objects["fur.body"] + +#https://docs.blender.org/api/2.79b/bpy.ops.object.html?highlight=object#bpy.ops.object.select_pattern +#Select objects matching a naming pattern +bpy.ops.object.select_pattern(pattern="fur.*", case_sensitive=False, extend=True) + +# join them together ctrl+j +bpy.ops.object.join() + +bpy.ops.object.select_all(action='DESELECT') + +#put object as active +bpy.context.scene.objects.active = bpy.data.objects["sheep.body"] + +#https://docs.blender.org/api/2.79b/bpy.ops.object.html?highlight=object#bpy.ops.object.select_pattern +#Select objects matching a naming pattern +bpy.ops.object.select_pattern(pattern="sheep.*", case_sensitive=False, extend=True) + +# join them together ctrl+j +bpy.ops.object.join() + +#bpy.ops.object.select_all(action='TOGGLE') +bpy.ops.object.select_all(action='SELECT') + +# ctrl+shift+alt+c set origin to 3d cursor +bpy.ops.object.origin_set(type='ORIGIN_CURSOR') + + +def get_override(area_type, region_type): + for area in bpy.context.screen.areas: + if area.type == area_type: + for region in area.regions: + if region.type == region_type: + override = {'area': area, 'region': region} + return override + #error message if the area or region wasn't found + raise RuntimeError("Wasn't able to find", region_type," in area ", area_type, + "\n Make sure it's open while executing script.") + + +#we need to override the context of our operator +override = get_override( 'VIEW_3D', 'WINDOW' ) +#rotate about the X-axis by 45 degrees +bpy.ops.transform.rotate(override, axis=(0,0,1)) +bpy.ops.transform.rotate(override, axis=(0,0,1)) + +blend_file_path = bpy.data.filepath +directory = os.path.dirname(blend_file_path) +#target_file = os.path.join(directory, 'agent.obj') +#target_file = os.path.join(directory, 'exported/agent.b3d') +target_file = os.path.join(directory, 'sheep.b3d') +target_file_new = os.path.join(directory, 'sheep.blend1') + +#bpy.ops.export_scene.obj(filepath=target_file) +bpy.ops.screen.b3d_export(filepath=target_file) + +#bpy.ops.export_scene.obj() +#bpy.ops.screen.b3d_export() + +#save as for testing +bpy.ops.wm.save_as_mainfile(filepath=target_file_new) + +# exits blender +bpy.ops.wm.quit_blender() diff --git a/models/extra/blender-scripting/+/sheep_baby.py b/models/extra/blender-scripting/+/sheep_baby.py new file mode 100644 index 0000000..695d74f --- /dev/null +++ b/models/extra/blender-scripting/+/sheep_baby.py @@ -0,0 +1,70 @@ +import bpy +import os + +#bpy.ops.object.select_all(action='DESELECT') + +#put object as active +bpy.context.scene.objects.active = bpy.data.objects["fur.body"] + +#https://docs.blender.org/api/2.79b/bpy.ops.object.html?highlight=object#bpy.ops.object.select_pattern +#Select objects matching a naming pattern +bpy.ops.object.select_pattern(pattern="fur.*", case_sensitive=False, extend=True) + +# join them together ctrl+j +bpy.ops.object.join() + +bpy.ops.object.select_all(action='DESELECT') + +#put object as active +bpy.context.scene.objects.active = bpy.data.objects["sheep.body"] + +#https://docs.blender.org/api/2.79b/bpy.ops.object.html?highlight=object#bpy.ops.object.select_pattern +#Select objects matching a naming pattern +bpy.ops.object.select_pattern(pattern="sheep.*", case_sensitive=False, extend=True) + +# join them together ctrl+j +bpy.ops.object.join() + +#bpy.ops.object.select_all(action='TOGGLE') +bpy.ops.object.select_all(action='SELECT') + +# ctrl+shift+alt+c set origin to 3d cursor +bpy.ops.object.origin_set(type='ORIGIN_CURSOR') + + +def get_override(area_type, region_type): + for area in bpy.context.screen.areas: + if area.type == area_type: + for region in area.regions: + if region.type == region_type: + override = {'area': area, 'region': region} + return override + #error message if the area or region wasn't found + raise RuntimeError("Wasn't able to find", region_type," in area ", area_type, + "\n Make sure it's open while executing script.") + + +#we need to override the context of our operator +override = get_override( 'VIEW_3D', 'WINDOW' ) +#rotate about the X-axis by 45 degrees +bpy.ops.transform.rotate(override, axis=(0,0,1)) +bpy.ops.transform.rotate(override, axis=(0,0,1)) + +blend_file_path = bpy.data.filepath +directory = os.path.dirname(blend_file_path) +#target_file = os.path.join(directory, 'agent.obj') +#target_file = os.path.join(directory, 'exported/agent.b3d') +target_file = os.path.join(directory, 'sheep_baby.b3d') +target_file_new = os.path.join(directory, 'sheep_baby.blend1') + +#bpy.ops.export_scene.obj(filepath=target_file) +bpy.ops.screen.b3d_export(filepath=target_file) + +#bpy.ops.export_scene.obj() +#bpy.ops.screen.b3d_export() + +#save as for testing +bpy.ops.wm.save_as_mainfile(filepath=target_file_new) + +# exits blender +bpy.ops.wm.quit_blender() diff --git a/models/extra/blender-scripting/+/skeleton_mc.py b/models/extra/blender-scripting/+/skeleton_mc.py new file mode 100644 index 0000000..875f710 --- /dev/null +++ b/models/extra/blender-scripting/+/skeleton_mc.py @@ -0,0 +1,86 @@ +import bpy +import os + +#bpy.ops.object.select_all(action='DESELECT') + +#put object as active +bpy.context.scene.objects.active = bpy.data.objects["stray_head2"] + +#https://docs.blender.org/api/2.79b/bpy.ops.object.html?highlight=object#bpy.ops.object.select_pattern +#Select objects matching a naming pattern +bpy.ops.object.select_pattern(pattern="stray_*", case_sensitive=False, extend=True) + +# delete selected +bpy.ops.object.delete(use_global=False) + +#put object as active +bpy.context.scene.objects.active = bpy.data.objects["ipp_bow"] + +#https://docs.blender.org/api/2.79b/bpy.ops.object.html?highlight=object#bpy.ops.object.select_pattern +#Select objects matching a naming pattern +bpy.ops.object.select_pattern(pattern="ipp_bo*", case_sensitive=False, extend=True) +bpy.ops.object.select_pattern(pattern="ipp_stone*", case_sensitive=False, extend=True) +bpy.ops.object.select_pattern(pattern="imc_stone*", case_sensitive=False, extend=True) + +# delete selected +bpy.ops.object.delete(use_global=False) + +bpy.ops.object.select_all(action='DESELECT') + +#put object as active +bpy.context.scene.objects.active = bpy.data.objects["skely_body3"] + +#https://docs.blender.org/api/2.79b/bpy.ops.object.html?highlight=object#bpy.ops.object.select_pattern +#Select objects matching a naming pattern +bpy.ops.object.select_pattern(pattern="skely_*", case_sensitive=False, extend=True) + +# join them together ctrl+j +bpy.ops.object.join() + +#bpy.ops.object.select_all(action='TOGGLE') +bpy.ops.object.select_all(action='SELECT') + +# ctrl+shift+alt+c set origin to 3d cursor +bpy.ops.object.origin_set(type='ORIGIN_CURSOR') + + +def get_override(area_type, region_type): + for area in bpy.context.screen.areas: + if area.type == area_type: + for region in area.regions: + if region.type == region_type: + override = {'area': area, 'region': region} + return override + #error message if the area or region wasn't found + raise RuntimeError("Wasn't able to find", region_type," in area ", area_type, + "\n Make sure it's open while executing script.") + + +#we need to override the context of our operator +override = get_override( 'VIEW_3D', 'WINDOW' ) +#rotate about the X-axis by 45 degrees +bpy.ops.transform.rotate(override, axis=(0,0,1)) +bpy.ops.transform.rotate(override, axis=(0,0,1)) + + + + + +blend_file_path = bpy.data.filepath +directory = os.path.dirname(blend_file_path) +#target_file = os.path.join(directory, 'agent.obj') +#target_file = os.path.join(directory, 'exported/agent.b3d') +target_file = os.path.join(directory, 'skeleton_mc.b3d') +target_file_new = os.path.join(directory, 'skeleton+skeleton_stray+wither_skeleton.blend1') + +#bpy.ops.export_scene.obj(filepath=target_file) +bpy.ops.screen.b3d_export(filepath=target_file) + +#bpy.ops.export_scene.obj() +#bpy.ops.screen.b3d_export() + +#save as for testing +bpy.ops.wm.save_as_mainfile(filepath=target_file_new) + +# exits blender +bpy.ops.wm.quit_blender() diff --git a/models/extra/blender-scripting/+/skeleton_pp.py b/models/extra/blender-scripting/+/skeleton_pp.py new file mode 100644 index 0000000..173ac85 --- /dev/null +++ b/models/extra/blender-scripting/+/skeleton_pp.py @@ -0,0 +1,86 @@ +import bpy +import os + +#bpy.ops.object.select_all(action='DESELECT') + +#put object as active +bpy.context.scene.objects.active = bpy.data.objects["stray_head2"] + +#https://docs.blender.org/api/2.79b/bpy.ops.object.html?highlight=object#bpy.ops.object.select_pattern +#Select objects matching a naming pattern +bpy.ops.object.select_pattern(pattern="stray_*", case_sensitive=False, extend=True) + +# delete selected +bpy.ops.object.delete(use_global=False) + +#put object as active +bpy.context.scene.objects.active = bpy.data.objects["imc_bow"] + +#https://docs.blender.org/api/2.79b/bpy.ops.object.html?highlight=object#bpy.ops.object.select_pattern +#Select objects matching a naming pattern +bpy.ops.object.select_pattern(pattern="imc_bo*", case_sensitive=False, extend=True) +bpy.ops.object.select_pattern(pattern="ipp_stone*", case_sensitive=False, extend=True) +bpy.ops.object.select_pattern(pattern="imc_stone*", case_sensitive=False, extend=True) + +# delete selected +bpy.ops.object.delete(use_global=False) + +bpy.ops.object.select_all(action='DESELECT') + +#put object as active +bpy.context.scene.objects.active = bpy.data.objects["skely_body3"] + +#https://docs.blender.org/api/2.79b/bpy.ops.object.html?highlight=object#bpy.ops.object.select_pattern +#Select objects matching a naming pattern +bpy.ops.object.select_pattern(pattern="skely_*", case_sensitive=False, extend=True) + +# join them together ctrl+j +bpy.ops.object.join() + +#bpy.ops.object.select_all(action='TOGGLE') +bpy.ops.object.select_all(action='SELECT') + +# ctrl+shift+alt+c set origin to 3d cursor +bpy.ops.object.origin_set(type='ORIGIN_CURSOR') + + +def get_override(area_type, region_type): + for area in bpy.context.screen.areas: + if area.type == area_type: + for region in area.regions: + if region.type == region_type: + override = {'area': area, 'region': region} + return override + #error message if the area or region wasn't found + raise RuntimeError("Wasn't able to find", region_type," in area ", area_type, + "\n Make sure it's open while executing script.") + + +#we need to override the context of our operator +override = get_override( 'VIEW_3D', 'WINDOW' ) +#rotate about the X-axis by 45 degrees +bpy.ops.transform.rotate(override, axis=(0,0,1)) +bpy.ops.transform.rotate(override, axis=(0,0,1)) + + + + + +blend_file_path = bpy.data.filepath +directory = os.path.dirname(blend_file_path) +#target_file = os.path.join(directory, 'agent.obj') +#target_file = os.path.join(directory, 'exported/agent.b3d') +target_file = os.path.join(directory, 'skeleton_pp.b3d') +target_file_new = os.path.join(directory, 'skeleton+skeleton_stray+wither_skeleton.blend1') + +#bpy.ops.export_scene.obj(filepath=target_file) +bpy.ops.screen.b3d_export(filepath=target_file) + +#bpy.ops.export_scene.obj() +#bpy.ops.screen.b3d_export() + +#save as for testing +bpy.ops.wm.save_as_mainfile(filepath=target_file_new) + +# exits blender +bpy.ops.wm.quit_blender() diff --git a/models/extra/blender-scripting/+/skeleton_stray_mc.py b/models/extra/blender-scripting/+/skeleton_stray_mc.py new file mode 100644 index 0000000..b39b213 --- /dev/null +++ b/models/extra/blender-scripting/+/skeleton_stray_mc.py @@ -0,0 +1,88 @@ +import bpy +import os + +#bpy.ops.object.select_all(action='DESELECT') + +#put object as active +bpy.context.scene.objects.active = bpy.data.objects["ipp_bow"] + +#https://docs.blender.org/api/2.79b/bpy.ops.object.html?highlight=object#bpy.ops.object.select_pattern +#Select objects matching a naming pattern +bpy.ops.object.select_pattern(pattern="imc_st*", case_sensitive=False, extend=True) +bpy.ops.object.select_pattern(pattern="ipp_bo*", case_sensitive=False, extend=True) +bpy.ops.object.select_pattern(pattern="ipp_stone*", case_sensitive=False, extend=True) + +# delete selected +bpy.ops.object.delete(use_global=False) + +bpy.ops.object.select_all(action='DESELECT') + +#put object as active +bpy.context.scene.objects.active = bpy.data.objects["skely_body3"] + +#https://docs.blender.org/api/2.79b/bpy.ops.object.html?highlight=object#bpy.ops.object.select_pattern +#Select objects matching a naming pattern +bpy.ops.object.select_pattern(pattern="skely_*", case_sensitive=False, extend=True) + +# join them together ctrl+j +bpy.ops.object.join() + +bpy.ops.object.select_all(action='DESELECT') + +#put object as active +bpy.context.scene.objects.active = bpy.data.objects["stray_body1"] + +#https://docs.blender.org/api/2.79b/bpy.ops.object.html?highlight=object#bpy.ops.object.select_pattern +#Select objects matching a naming pattern +bpy.ops.object.select_pattern(pattern="stray_*", case_sensitive=False, extend=True) + +# join them together ctrl+j +bpy.ops.object.join() + +#bpy.ops.object.select_all(action='TOGGLE') +bpy.ops.object.select_all(action='SELECT') + +# ctrl+shift+alt+c set origin to 3d cursor +bpy.ops.object.origin_set(type='ORIGIN_CURSOR') + + +def get_override(area_type, region_type): + for area in bpy.context.screen.areas: + if area.type == area_type: + for region in area.regions: + if region.type == region_type: + override = {'area': area, 'region': region} + return override + #error message if the area or region wasn't found + raise RuntimeError("Wasn't able to find", region_type," in area ", area_type, + "\n Make sure it's open while executing script.") + + +#we need to override the context of our operator +override = get_override( 'VIEW_3D', 'WINDOW' ) +#rotate about the X-axis by 45 degrees +bpy.ops.transform.rotate(override, axis=(0,0,1)) +bpy.ops.transform.rotate(override, axis=(0,0,1)) + + + + + +blend_file_path = bpy.data.filepath +directory = os.path.dirname(blend_file_path) +#target_file = os.path.join(directory, 'agent.obj') +#target_file = os.path.join(directory, 'exported/agent.b3d') +target_file = os.path.join(directory, 'skeleton_stray_mc.b3d') +target_file_new = os.path.join(directory, 'skeleton+skeleton_stray+wither_skeleton.blend1') + +#bpy.ops.export_scene.obj(filepath=target_file) +bpy.ops.screen.b3d_export(filepath=target_file) + +#bpy.ops.export_scene.obj() +#bpy.ops.screen.b3d_export() + +#save as for testing +bpy.ops.wm.save_as_mainfile(filepath=target_file_new) + +# exits blender +bpy.ops.wm.quit_blender() diff --git a/models/extra/blender-scripting/+/skeleton_stray_pp.py b/models/extra/blender-scripting/+/skeleton_stray_pp.py new file mode 100644 index 0000000..f5b07a5 --- /dev/null +++ b/models/extra/blender-scripting/+/skeleton_stray_pp.py @@ -0,0 +1,88 @@ +import bpy +import os + +#bpy.ops.object.select_all(action='DESELECT') + +#put object as active +bpy.context.scene.objects.active = bpy.data.objects["ipp_bow"] + +#https://docs.blender.org/api/2.79b/bpy.ops.object.html?highlight=object#bpy.ops.object.select_pattern +#Select objects matching a naming pattern +bpy.ops.object.select_pattern(pattern="imc_st*", case_sensitive=False, extend=True) +bpy.ops.object.select_pattern(pattern="imc_bo*", case_sensitive=False, extend=True) +bpy.ops.object.select_pattern(pattern="ipp_stone*", case_sensitive=False, extend=True) + +# delete selected +bpy.ops.object.delete(use_global=False) + +bpy.ops.object.select_all(action='DESELECT') + +#put object as active +bpy.context.scene.objects.active = bpy.data.objects["skely_body3"] + +#https://docs.blender.org/api/2.79b/bpy.ops.object.html?highlight=object#bpy.ops.object.select_pattern +#Select objects matching a naming pattern +bpy.ops.object.select_pattern(pattern="skely_*", case_sensitive=False, extend=True) + +# join them together ctrl+j +bpy.ops.object.join() + +bpy.ops.object.select_all(action='DESELECT') + +#put object as active +bpy.context.scene.objects.active = bpy.data.objects["stray_body1"] + +#https://docs.blender.org/api/2.79b/bpy.ops.object.html?highlight=object#bpy.ops.object.select_pattern +#Select objects matching a naming pattern +bpy.ops.object.select_pattern(pattern="stray_*", case_sensitive=False, extend=True) + +# join them together ctrl+j +bpy.ops.object.join() + +#bpy.ops.object.select_all(action='TOGGLE') +bpy.ops.object.select_all(action='SELECT') + +# ctrl+shift+alt+c set origin to 3d cursor +bpy.ops.object.origin_set(type='ORIGIN_CURSOR') + + +def get_override(area_type, region_type): + for area in bpy.context.screen.areas: + if area.type == area_type: + for region in area.regions: + if region.type == region_type: + override = {'area': area, 'region': region} + return override + #error message if the area or region wasn't found + raise RuntimeError("Wasn't able to find", region_type," in area ", area_type, + "\n Make sure it's open while executing script.") + + +#we need to override the context of our operator +override = get_override( 'VIEW_3D', 'WINDOW' ) +#rotate about the X-axis by 45 degrees +bpy.ops.transform.rotate(override, axis=(0,0,1)) +bpy.ops.transform.rotate(override, axis=(0,0,1)) + + + + + +blend_file_path = bpy.data.filepath +directory = os.path.dirname(blend_file_path) +#target_file = os.path.join(directory, 'agent.obj') +#target_file = os.path.join(directory, 'exported/agent.b3d') +target_file = os.path.join(directory, 'skeleton_stray_pp.b3d') +target_file_new = os.path.join(directory, 'skeleton+skeleton_stray+wither_skeleton.blend1') + +#bpy.ops.export_scene.obj(filepath=target_file) +bpy.ops.screen.b3d_export(filepath=target_file) + +#bpy.ops.export_scene.obj() +#bpy.ops.screen.b3d_export() + +#save as for testing +bpy.ops.wm.save_as_mainfile(filepath=target_file_new) + +# exits blender +bpy.ops.wm.quit_blender() diff --git a/models/extra/blender-scripting/+/snowman.py b/models/extra/blender-scripting/+/snowman.py new file mode 100644 index 0000000..5ed0a92 --- /dev/null +++ b/models/extra/blender-scripting/+/snowman.py @@ -0,0 +1,62 @@ +import bpy +import os + + + +#put object as active +bpy.context.scene.objects.active = bpy.data.objects["snow_legs"] + +#https://docs.blender.org/api/2.79b/bpy.ops.object.html?highlight=object#bpy.ops.object.select_pattern +#Select objects matching a naming pattern +bpy.ops.object.select_pattern(pattern="snow_*", case_sensitive=False, extend=True) + +# join them together ctrl+j +bpy.ops.object.join() + +#bpy.ops.object.select_all(action='TOGGLE') +bpy.ops.object.select_all(action='SELECT') + +# ctrl+shift+alt+c set origin to 3d cursor +bpy.ops.object.origin_set(type='ORIGIN_CURSOR') + + +def get_override(area_type, region_type): + for area in bpy.context.screen.areas: + if area.type == area_type: + for region in area.regions: + if region.type == region_type: + override = {'area': area, 'region': region} + return override + #error message if the area or region wasn't found + raise RuntimeError("Wasn't able to find", region_type," in area ", area_type, + "\n Make sure it's open while executing script.") + + +#we need to override the context of our operator +override = get_override( 'VIEW_3D', 'WINDOW' ) +#rotate about the X-axis by 45 degrees +bpy.ops.transform.rotate(override, axis=(0,0,1)) +bpy.ops.transform.rotate(override, axis=(0,0,1)) + + + + + +blend_file_path = bpy.data.filepath +directory = os.path.dirname(blend_file_path) +#target_file = os.path.join(directory, 'agent.obj') +#target_file = os.path.join(directory, 'exported/agent.b3d') +target_file = os.path.join(directory, 'snowman.b3d') +target_file_new = os.path.join(directory, 'snowman.blend1') + +#bpy.ops.export_scene.obj(filepath=target_file) +bpy.ops.screen.b3d_export(filepath=target_file) + +#bpy.ops.export_scene.obj() +#bpy.ops.screen.b3d_export() + +#save as for testing +bpy.ops.wm.save_as_mainfile(filepath=target_file_new) + +# exits blender +bpy.ops.wm.quit_blender() diff --git a/models/extra/blender-scripting/+/vex_mc.py b/models/extra/blender-scripting/+/vex_mc.py new file mode 100644 index 0000000..d722e6e --- /dev/null +++ b/models/extra/blender-scripting/+/vex_mc.py @@ -0,0 +1,74 @@ +import bpy +import os + +#bpy.ops.object.select_all(action='DESELECT') + +#put object as active +bpy.context.scene.objects.active = bpy.data.objects["ipp_iron.sword"] + +#https://docs.blender.org/api/2.79b/bpy.ops.object.html?highlight=object#bpy.ops.object.select_pattern +#Select objects matching a naming pattern +bpy.ops.object.select_pattern(pattern="ipp_iron*", case_sensitive=False, extend=True) + +# delete selected +bpy.ops.object.delete(use_global=False) + +bpy.ops.object.select_all(action='DESELECT') + +#put object as active +bpy.context.scene.objects.active = bpy.data.objects["vex_body"] + +#https://docs.blender.org/api/2.79b/bpy.ops.object.html?highlight=object#bpy.ops.object.select_pattern +#Select objects matching a naming pattern +bpy.ops.object.select_pattern(pattern="vex_*", case_sensitive=False, extend=True) + +# join them together ctrl+j +bpy.ops.object.join() + +#bpy.ops.object.select_all(action='TOGGLE') +bpy.ops.object.select_all(action='SELECT') + +# ctrl+shift+alt+c set origin to 3d cursor +bpy.ops.object.origin_set(type='ORIGIN_CURSOR') + + +def get_override(area_type, region_type): + for area in bpy.context.screen.areas: + if area.type == area_type: + for region in area.regions: + if region.type == region_type: + override = {'area': area, 'region': region} + return override + #error message if the area or region wasn't found + raise RuntimeError("Wasn't able to find", region_type," in area ", area_type, + "\n Make sure it's open while executing script.") + + +#we need to override the context of our operator +override = get_override( 'VIEW_3D', 'WINDOW' ) +#rotate about the X-axis by 45 degrees +bpy.ops.transform.rotate(override, axis=(0,0,1)) +bpy.ops.transform.rotate(override, axis=(0,0,1)) + + + + + +blend_file_path = bpy.data.filepath +directory = os.path.dirname(blend_file_path) +#target_file = os.path.join(directory, 'agent.obj') +#target_file = os.path.join(directory, 'exported/agent.b3d') +target_file = os.path.join(directory, 'vex_mc.b3d') +target_file_new = os.path.join(directory, 'vex.blend1') + +#bpy.ops.export_scene.obj(filepath=target_file) +bpy.ops.screen.b3d_export(filepath=target_file) + +#bpy.ops.export_scene.obj() +#bpy.ops.screen.b3d_export() + +#save as for testing +bpy.ops.wm.save_as_mainfile(filepath=target_file_new) + +# exits blender +bpy.ops.wm.quit_blender() diff --git a/models/extra/blender-scripting/+/vex_pp.py b/models/extra/blender-scripting/+/vex_pp.py new file mode 100644 index 0000000..0e52522 --- /dev/null +++ b/models/extra/blender-scripting/+/vex_pp.py @@ -0,0 +1,74 @@ +import bpy +import os + +#bpy.ops.object.select_all(action='DESELECT') + +#put object as active +bpy.context.scene.objects.active = bpy.data.objects["imc_iron.sword"] + +#https://docs.blender.org/api/2.79b/bpy.ops.object.html?highlight=object#bpy.ops.object.select_pattern +#Select objects matching a naming pattern +bpy.ops.object.select_pattern(pattern="imc_iron*", case_sensitive=False, extend=True) + +# delete selected +bpy.ops.object.delete(use_global=False) + +bpy.ops.object.select_all(action='DESELECT') + +#put object as active +bpy.context.scene.objects.active = bpy.data.objects["vex_body"] + +#https://docs.blender.org/api/2.79b/bpy.ops.object.html?highlight=object#bpy.ops.object.select_pattern +#Select objects matching a naming pattern +bpy.ops.object.select_pattern(pattern="vex_*", case_sensitive=False, extend=True) + +# join them together ctrl+j +bpy.ops.object.join() + +#bpy.ops.object.select_all(action='TOGGLE') +bpy.ops.object.select_all(action='SELECT') + +# ctrl+shift+alt+c set origin to 3d cursor +bpy.ops.object.origin_set(type='ORIGIN_CURSOR') + + +def get_override(area_type, region_type): + for area in bpy.context.screen.areas: + if area.type == area_type: + for region in area.regions: + if region.type == region_type: + override = {'area': area, 'region': region} + return override + #error message if the area or region wasn't found + raise RuntimeError("Wasn't able to find", region_type," in area ", area_type, + "\n Make sure it's open while executing script.") + + +#we need to override the context of our operator +override = get_override( 'VIEW_3D', 'WINDOW' ) +#rotate about the X-axis by 45 degrees +bpy.ops.transform.rotate(override, axis=(0,0,1)) +bpy.ops.transform.rotate(override, axis=(0,0,1)) + + + + + +blend_file_path = bpy.data.filepath +directory = os.path.dirname(blend_file_path) +#target_file = os.path.join(directory, 'agent.obj') +#target_file = os.path.join(directory, 'exported/agent.b3d') +target_file = os.path.join(directory, 'vex_pp.b3d') +target_file_new = os.path.join(directory, 'vex.blend1') + +#bpy.ops.export_scene.obj(filepath=target_file) +bpy.ops.screen.b3d_export(filepath=target_file) + +#bpy.ops.export_scene.obj() +#bpy.ops.screen.b3d_export() + +#save as for testing +bpy.ops.wm.save_as_mainfile(filepath=target_file_new) + +# exits blender +bpy.ops.wm.quit_blender() diff --git a/models/extra/blender-scripting/+/villager.py b/models/extra/blender-scripting/+/villager.py new file mode 100644 index 0000000..3939315 --- /dev/null +++ b/models/extra/blender-scripting/+/villager.py @@ -0,0 +1,87 @@ +import bpy +import os + +#put object as active +bpy.context.scene.objects.active = bpy.data.objects["imc_bow"] + +#https://docs.blender.org/api/2.79b/bpy.ops.object.html?highlight=object#bpy.ops.object.select_pattern +#Select objects matching a naming pattern +bpy.ops.object.select_pattern(pattern="imc_bo*", case_sensitive=False, extend=True) +bpy.ops.object.select_pattern(pattern="ipp_bo*", case_sensitive=False, extend=True) +bpy.ops.object.select_pattern(pattern="imc_iron*", case_sensitive=False, extend=True) +bpy.ops.object.select_pattern(pattern="ipp_iron*", case_sensitive=False, extend=True) + +# delete selected +bpy.ops.object.delete(use_global=False) + +bpy.ops.object.select_all(action='DESELECT') + +#put object as active +bpy.context.scene.objects.active = bpy.data.objects["evo_body"] + +#https://docs.blender.org/api/2.79b/bpy.ops.object.html?highlight=object#bpy.ops.object.select_pattern +#Select objects matching a naming pattern +bpy.ops.object.select_pattern(pattern="evo_*", case_sensitive=False, extend=True) + +# join them together ctrl+j +bpy.ops.object.join() + +bpy.ops.object.select_all(action='DESELECT') + +#put object as active +bpy.context.scene.objects.active = bpy.data.objects["hat_head1"] + +#https://docs.blender.org/api/2.79b/bpy.ops.object.html?highlight=object#bpy.ops.object.select_pattern +#Select objects matching a naming pattern +bpy.ops.object.select_pattern(pattern="hat_*", case_sensitive=False, extend=True) + +# join them together ctrl+j +bpy.ops.object.join() + +#bpy.ops.object.select_all(action='TOGGLE') +bpy.ops.object.select_all(action='SELECT') + +# ctrl+shift+alt+c set origin to 3d cursor +bpy.ops.object.origin_set(type='ORIGIN_CURSOR') + + +def get_override(area_type, region_type): + for area in bpy.context.screen.areas: + if area.type == area_type: + for region in area.regions: + if region.type == region_type: + override = {'area': area, 'region': region} + return override + #error message if the area or region wasn't found + raise RuntimeError("Wasn't able to find", region_type," in area ", area_type, + "\n Make sure it's open while executing script.") + + +#we need to override the context of our operator +override = get_override( 'VIEW_3D', 'WINDOW' ) +#rotate about the X-axis by 45 degrees +bpy.ops.transform.rotate(override, axis=(0,0,1)) +bpy.ops.transform.rotate(override, axis=(0,0,1)) + + + + + +blend_file_path = bpy.data.filepath +directory = os.path.dirname(blend_file_path) +#target_file = os.path.join(directory, 'agent.obj') +#target_file = os.path.join(directory, 'exported/agent.b3d') +target_file = os.path.join(directory, 'villager.b3d') +target_file_new = os.path.join(directory, 'vindicator+evoker+illusioner+villager+baby.blend1') + +#bpy.ops.export_scene.obj(filepath=target_file) +bpy.ops.screen.b3d_export(filepath=target_file) + +#bpy.ops.export_scene.obj() +#bpy.ops.screen.b3d_export() + +#save as for testing +bpy.ops.wm.save_as_mainfile(filepath=target_file_new) + +# exits blender +bpy.ops.wm.quit_blender() diff --git a/models/extra/blender-scripting/+/vindicator_mc.py b/models/extra/blender-scripting/+/vindicator_mc.py new file mode 100644 index 0000000..a4ea6bf --- /dev/null +++ b/models/extra/blender-scripting/+/vindicator_mc.py @@ -0,0 +1,86 @@ +import bpy +import os + +#put object as active +bpy.context.scene.objects.active = bpy.data.objects["imc_bow"] + +#https://docs.blender.org/api/2.79b/bpy.ops.object.html?highlight=object#bpy.ops.object.select_pattern +#Select objects matching a naming pattern +bpy.ops.object.select_pattern(pattern="imc_bo*", case_sensitive=False, extend=True) +bpy.ops.object.select_pattern(pattern="ipp_bo*", case_sensitive=False, extend=True) +bpy.ops.object.select_pattern(pattern="ipp_iron*", case_sensitive=False, extend=True) + +# delete selected +bpy.ops.object.delete(use_global=False) + +bpy.ops.object.select_all(action='DESELECT') + +#put object as active +bpy.context.scene.objects.active = bpy.data.objects["evo_body"] + +#https://docs.blender.org/api/2.79b/bpy.ops.object.html?highlight=object#bpy.ops.object.select_pattern +#Select objects matching a naming pattern +bpy.ops.object.select_pattern(pattern="evo_*", case_sensitive=False, extend=True) + +# join them together ctrl+j +bpy.ops.object.join() + +bpy.ops.object.select_all(action='DESELECT') + +#put object as active +bpy.context.scene.objects.active = bpy.data.objects["hat_head1"] + +#https://docs.blender.org/api/2.79b/bpy.ops.object.html?highlight=object#bpy.ops.object.select_pattern +#Select objects matching a naming pattern +bpy.ops.object.select_pattern(pattern="hat_*", case_sensitive=False, extend=True) + +# join them together ctrl+j +bpy.ops.object.join() + +#bpy.ops.object.select_all(action='TOGGLE') +bpy.ops.object.select_all(action='SELECT') + +# ctrl+shift+alt+c set origin to 3d cursor +bpy.ops.object.origin_set(type='ORIGIN_CURSOR') + + +def get_override(area_type, region_type): + for area in bpy.context.screen.areas: + if area.type == area_type: + for region in area.regions: + if region.type == region_type: + override = {'area': area, 'region': region} + return override + #error message if the area or region wasn't found + raise RuntimeError("Wasn't able to find", region_type," in area ", area_type, + "\n Make sure it's open while executing script.") + + +#we need to override the context of our operator +override = get_override( 'VIEW_3D', 'WINDOW' ) +#rotate about the X-axis by 45 degrees +bpy.ops.transform.rotate(override, axis=(0,0,1)) +bpy.ops.transform.rotate(override, axis=(0,0,1)) + + + + + +blend_file_path = bpy.data.filepath +directory = os.path.dirname(blend_file_path) +#target_file = os.path.join(directory, 'agent.obj') +#target_file = os.path.join(directory, 'exported/agent.b3d') +target_file = os.path.join(directory, 'vindicator_mc.b3d') +target_file_new = os.path.join(directory, 'vindicator+evoker+illusioner+villager+baby.blend1') + +#bpy.ops.export_scene.obj(filepath=target_file) +bpy.ops.screen.b3d_export(filepath=target_file) + +#bpy.ops.export_scene.obj() +#bpy.ops.screen.b3d_export() + +#save as for testing +bpy.ops.wm.save_as_mainfile(filepath=target_file_new) + +# exits blender +bpy.ops.wm.quit_blender() diff --git a/models/extra/blender-scripting/+/vindicator_pp.py b/models/extra/blender-scripting/+/vindicator_pp.py new file mode 100644 index 0000000..6855b5a --- /dev/null +++ b/models/extra/blender-scripting/+/vindicator_pp.py @@ -0,0 +1,86 @@ +import bpy +import os + +#put object as active +bpy.context.scene.objects.active = bpy.data.objects["imc_bow"] + +#https://docs.blender.org/api/2.79b/bpy.ops.object.html?highlight=object#bpy.ops.object.select_pattern +#Select objects matching a naming pattern +bpy.ops.object.select_pattern(pattern="imc_bo*", case_sensitive=False, extend=True) +bpy.ops.object.select_pattern(pattern="ipp_bo*", case_sensitive=False, extend=True) +bpy.ops.object.select_pattern(pattern="imc_iron*", case_sensitive=False, extend=True) + +# delete selected +bpy.ops.object.delete(use_global=False) + +bpy.ops.object.select_all(action='DESELECT') + +#put object as active +bpy.context.scene.objects.active = bpy.data.objects["evo_body"] + +#https://docs.blender.org/api/2.79b/bpy.ops.object.html?highlight=object#bpy.ops.object.select_pattern +#Select objects matching a naming pattern +bpy.ops.object.select_pattern(pattern="evo_*", case_sensitive=False, extend=True) + +# join them together ctrl+j +bpy.ops.object.join() + +bpy.ops.object.select_all(action='DESELECT') + +#put object as active +bpy.context.scene.objects.active = bpy.data.objects["hat_head1"] + +#https://docs.blender.org/api/2.79b/bpy.ops.object.html?highlight=object#bpy.ops.object.select_pattern +#Select objects matching a naming pattern +bpy.ops.object.select_pattern(pattern="hat_*", case_sensitive=False, extend=True) + +# join them together ctrl+j +bpy.ops.object.join() + +#bpy.ops.object.select_all(action='TOGGLE') +bpy.ops.object.select_all(action='SELECT') + +# ctrl+shift+alt+c set origin to 3d cursor +bpy.ops.object.origin_set(type='ORIGIN_CURSOR') + + +def get_override(area_type, region_type): + for area in bpy.context.screen.areas: + if area.type == area_type: + for region in area.regions: + if region.type == region_type: + override = {'area': area, 'region': region} + return override + #error message if the area or region wasn't found + raise RuntimeError("Wasn't able to find", region_type," in area ", area_type, + "\n Make sure it's open while executing script.") + + +#we need to override the context of our operator +override = get_override( 'VIEW_3D', 'WINDOW' ) +#rotate about the X-axis by 45 degrees +bpy.ops.transform.rotate(override, axis=(0,0,1)) +bpy.ops.transform.rotate(override, axis=(0,0,1)) + + + + + +blend_file_path = bpy.data.filepath +directory = os.path.dirname(blend_file_path) +#target_file = os.path.join(directory, 'agent.obj') +#target_file = os.path.join(directory, 'exported/agent.b3d') +target_file = os.path.join(directory, 'vindicator_pp.b3d') +target_file_new = os.path.join(directory, 'vindicator+evoker+illusioner+villager+baby.blend1') + +#bpy.ops.export_scene.obj(filepath=target_file) +bpy.ops.screen.b3d_export(filepath=target_file) + +#bpy.ops.export_scene.obj() +#bpy.ops.screen.b3d_export() + +#save as for testing +bpy.ops.wm.save_as_mainfile(filepath=target_file_new) + +# exits blender +bpy.ops.wm.quit_blender() diff --git a/models/extra/blender-scripting/+/wither_skeleton_mc.py b/models/extra/blender-scripting/+/wither_skeleton_mc.py new file mode 100644 index 0000000..8f20536 --- /dev/null +++ b/models/extra/blender-scripting/+/wither_skeleton_mc.py @@ -0,0 +1,86 @@ +import bpy +import os + +#bpy.ops.object.select_all(action='DESELECT') + +#put object as active +bpy.context.scene.objects.active = bpy.data.objects["stray_head2"] + +#https://docs.blender.org/api/2.79b/bpy.ops.object.html?highlight=object#bpy.ops.object.select_pattern +#Select objects matching a naming pattern +bpy.ops.object.select_pattern(pattern="stray_*", case_sensitive=False, extend=True) + +# delete selected +bpy.ops.object.delete(use_global=False) + +#put object as active +bpy.context.scene.objects.active = bpy.data.objects["imc_bow"] + +#https://docs.blender.org/api/2.79b/bpy.ops.object.html?highlight=object#bpy.ops.object.select_pattern +#Select objects matching a naming pattern +bpy.ops.object.select_pattern(pattern="imc_bo*", case_sensitive=False, extend=True) +bpy.ops.object.select_pattern(pattern="ipp_bo*", case_sensitive=False, extend=True) +bpy.ops.object.select_pattern(pattern="ipp_stone*", case_sensitive=False, extend=True) + +# delete selected +bpy.ops.object.delete(use_global=False) + +bpy.ops.object.select_all(action='DESELECT') + +#put object as active +bpy.context.scene.objects.active = bpy.data.objects["skely_body3"] + +#https://docs.blender.org/api/2.79b/bpy.ops.object.html?highlight=object#bpy.ops.object.select_pattern +#Select objects matching a naming pattern +bpy.ops.object.select_pattern(pattern="skely_*", case_sensitive=False, extend=True) + +# join them together ctrl+j +bpy.ops.object.join() + +#bpy.ops.object.select_all(action='TOGGLE') +bpy.ops.object.select_all(action='SELECT') + +# ctrl+shift+alt+c set origin to 3d cursor +bpy.ops.object.origin_set(type='ORIGIN_CURSOR') + + +def get_override(area_type, region_type): + for area in bpy.context.screen.areas: + if area.type == area_type: + for region in area.regions: + if region.type == region_type: + override = {'area': area, 'region': region} + return override + #error message if the area or region wasn't found + raise RuntimeError("Wasn't able to find", region_type," in area ", area_type, + "\n Make sure it's open while executing script.") + + +#we need to override the context of our operator +override = get_override( 'VIEW_3D', 'WINDOW' ) +#rotate about the X-axis by 45 degrees +bpy.ops.transform.rotate(override, axis=(0,0,1)) +bpy.ops.transform.rotate(override, axis=(0,0,1)) + + + + + +blend_file_path = bpy.data.filepath +directory = os.path.dirname(blend_file_path) +#target_file = os.path.join(directory, 'agent.obj') +#target_file = os.path.join(directory, 'exported/agent.b3d') +target_file = os.path.join(directory, 'wither_skeleton_mc.b3d') +target_file_new = os.path.join(directory, 'skeleton+skeleton_stray+wither_skeleton.blend1') + +#bpy.ops.export_scene.obj(filepath=target_file) +bpy.ops.screen.b3d_export(filepath=target_file) + +#bpy.ops.export_scene.obj() +#bpy.ops.screen.b3d_export() + +#save as for testing +bpy.ops.wm.save_as_mainfile(filepath=target_file_new) + +# exits blender +bpy.ops.wm.quit_blender() diff --git a/models/extra/blender-scripting/+/wither_skeleton_pp.py b/models/extra/blender-scripting/+/wither_skeleton_pp.py new file mode 100644 index 0000000..84aca4c --- /dev/null +++ b/models/extra/blender-scripting/+/wither_skeleton_pp.py @@ -0,0 +1,86 @@ +import bpy +import os + +#bpy.ops.object.select_all(action='DESELECT') + +#put object as active +bpy.context.scene.objects.active = bpy.data.objects["stray_head2"] + +#https://docs.blender.org/api/2.79b/bpy.ops.object.html?highlight=object#bpy.ops.object.select_pattern +#Select objects matching a naming pattern +bpy.ops.object.select_pattern(pattern="stray_*", case_sensitive=False, extend=True) + +# delete selected +bpy.ops.object.delete(use_global=False) + +#put object as active +bpy.context.scene.objects.active = bpy.data.objects["imc_bow"] + +#https://docs.blender.org/api/2.79b/bpy.ops.object.html?highlight=object#bpy.ops.object.select_pattern +#Select objects matching a naming pattern +bpy.ops.object.select_pattern(pattern="imc_bo*", case_sensitive=False, extend=True) +bpy.ops.object.select_pattern(pattern="ipp_bo*", case_sensitive=False, extend=True) +bpy.ops.object.select_pattern(pattern="imc_stone*", case_sensitive=False, extend=True) + +# delete selected +bpy.ops.object.delete(use_global=False) + +bpy.ops.object.select_all(action='DESELECT') + +#put object as active +bpy.context.scene.objects.active = bpy.data.objects["skely_body3"] + +#https://docs.blender.org/api/2.79b/bpy.ops.object.html?highlight=object#bpy.ops.object.select_pattern +#Select objects matching a naming pattern +bpy.ops.object.select_pattern(pattern="skely_*", case_sensitive=False, extend=True) + +# join them together ctrl+j +bpy.ops.object.join() + +#bpy.ops.object.select_all(action='TOGGLE') +bpy.ops.object.select_all(action='SELECT') + +# ctrl+shift+alt+c set origin to 3d cursor +bpy.ops.object.origin_set(type='ORIGIN_CURSOR') + + +def get_override(area_type, region_type): + for area in bpy.context.screen.areas: + if area.type == area_type: + for region in area.regions: + if region.type == region_type: + override = {'area': area, 'region': region} + return override + #error message if the area or region wasn't found + raise RuntimeError("Wasn't able to find", region_type," in area ", area_type, + "\n Make sure it's open while executing script.") + + +#we need to override the context of our operator +override = get_override( 'VIEW_3D', 'WINDOW' ) +#rotate about the X-axis by 45 degrees +bpy.ops.transform.rotate(override, axis=(0,0,1)) +bpy.ops.transform.rotate(override, axis=(0,0,1)) + + + + + +blend_file_path = bpy.data.filepath +directory = os.path.dirname(blend_file_path) +#target_file = os.path.join(directory, 'agent.obj') +#target_file = os.path.join(directory, 'exported/agent.b3d') +target_file = os.path.join(directory, 'wither_skeleton_pp.b3d') +target_file_new = os.path.join(directory, 'skeleton+skeleton_stray+wither_skeleton.blend1') + +#bpy.ops.export_scene.obj(filepath=target_file) +bpy.ops.screen.b3d_export(filepath=target_file) + +#bpy.ops.export_scene.obj() +#bpy.ops.screen.b3d_export() + +#save as for testing +bpy.ops.wm.save_as_mainfile(filepath=target_file_new) + +# exits blender +bpy.ops.wm.quit_blender() diff --git a/models/extra/blender-scripting/+/zombie_pigman_mc.py b/models/extra/blender-scripting/+/zombie_pigman_mc.py new file mode 100644 index 0000000..86ab7a4 --- /dev/null +++ b/models/extra/blender-scripting/+/zombie_pigman_mc.py @@ -0,0 +1,72 @@ +import bpy +import os + +#put object as active +bpy.context.scene.objects.active = bpy.data.objects["imc_gold.sword"] + +#https://docs.blender.org/api/2.79b/bpy.ops.object.html?highlight=object#bpy.ops.object.select_pattern +#Select objects matching a naming pattern +bpy.ops.object.select_pattern(pattern="ipp_gold*", case_sensitive=False, extend=True) + +# delete selected +bpy.ops.object.delete(use_global=False) + +bpy.ops.object.select_all(action='DESELECT') + +#put object as active +bpy.context.scene.objects.active = bpy.data.objects["pig_body"] + +#https://docs.blender.org/api/2.79b/bpy.ops.object.html?highlight=object#bpy.ops.object.select_pattern +#Select objects matching a naming pattern +bpy.ops.object.select_pattern(pattern="pig_*", case_sensitive=False, extend=True) + +# join them together ctrl+j +bpy.ops.object.join() + +#bpy.ops.object.select_all(action='TOGGLE') +bpy.ops.object.select_all(action='SELECT') + +# ctrl+shift+alt+c set origin to 3d cursor +bpy.ops.object.origin_set(type='ORIGIN_CURSOR') + + +def get_override(area_type, region_type): + for area in bpy.context.screen.areas: + if area.type == area_type: + for region in area.regions: + if region.type == region_type: + override = {'area': area, 'region': region} + return override + #error message if the area or region wasn't found + raise RuntimeError("Wasn't able to find", region_type," in area ", area_type, + "\n Make sure it's open while executing script.") + + +#we need to override the context of our operator +override = get_override( 'VIEW_3D', 'WINDOW' ) +#rotate about the X-axis by 45 degrees +bpy.ops.transform.rotate(override, axis=(0,0,1)) +bpy.ops.transform.rotate(override, axis=(0,0,1)) + + + + + +blend_file_path = bpy.data.filepath +directory = os.path.dirname(blend_file_path) +#target_file = os.path.join(directory, 'agent.obj') +#target_file = os.path.join(directory, 'exported/agent.b3d') +target_file = os.path.join(directory, 'zombie_pigman_mc.b3d') +target_file_new = os.path.join(directory, 'zombie_pigman+baby.blend1') + +#bpy.ops.export_scene.obj(filepath=target_file) +bpy.ops.screen.b3d_export(filepath=target_file) + +#bpy.ops.export_scene.obj() +#bpy.ops.screen.b3d_export() + +#save as for testing +bpy.ops.wm.save_as_mainfile(filepath=target_file_new) + +# exits blender +bpy.ops.wm.quit_blender() diff --git a/models/extra/blender-scripting/+/zombie_pigman_pp.py b/models/extra/blender-scripting/+/zombie_pigman_pp.py new file mode 100644 index 0000000..bf747ee --- /dev/null +++ b/models/extra/blender-scripting/+/zombie_pigman_pp.py @@ -0,0 +1,72 @@ +import bpy +import os + +#put object as active +bpy.context.scene.objects.active = bpy.data.objects["imc_gold.sword"] + +#https://docs.blender.org/api/2.79b/bpy.ops.object.html?highlight=object#bpy.ops.object.select_pattern +#Select objects matching a naming pattern +bpy.ops.object.select_pattern(pattern="imc_gold*", case_sensitive=False, extend=True) + +# delete selected +bpy.ops.object.delete(use_global=False) + +bpy.ops.object.select_all(action='DESELECT') + +#put object as active +bpy.context.scene.objects.active = bpy.data.objects["pig_body"] + +#https://docs.blender.org/api/2.79b/bpy.ops.object.html?highlight=object#bpy.ops.object.select_pattern +#Select objects matching a naming pattern +bpy.ops.object.select_pattern(pattern="pig_*", case_sensitive=False, extend=True) + +# join them together ctrl+j +bpy.ops.object.join() + +#bpy.ops.object.select_all(action='TOGGLE') +bpy.ops.object.select_all(action='SELECT') + +# ctrl+shift+alt+c set origin to 3d cursor +bpy.ops.object.origin_set(type='ORIGIN_CURSOR') + + +def get_override(area_type, region_type): + for area in bpy.context.screen.areas: + if area.type == area_type: + for region in area.regions: + if region.type == region_type: + override = {'area': area, 'region': region} + return override + #error message if the area or region wasn't found + raise RuntimeError("Wasn't able to find", region_type," in area ", area_type, + "\n Make sure it's open while executing script.") + + +#we need to override the context of our operator +override = get_override( 'VIEW_3D', 'WINDOW' ) +#rotate about the X-axis by 45 degrees +bpy.ops.transform.rotate(override, axis=(0,0,1)) +bpy.ops.transform.rotate(override, axis=(0,0,1)) + + + + + +blend_file_path = bpy.data.filepath +directory = os.path.dirname(blend_file_path) +#target_file = os.path.join(directory, 'agent.obj') +#target_file = os.path.join(directory, 'exported/agent.b3d') +target_file = os.path.join(directory, 'zombie_pigman_pp.b3d') +target_file_new = os.path.join(directory, 'zombie_pigman+baby.blend1') + +#bpy.ops.export_scene.obj(filepath=target_file) +bpy.ops.screen.b3d_export(filepath=target_file) + +#bpy.ops.export_scene.obj() +#bpy.ops.screen.b3d_export() + +#save as for testing +bpy.ops.wm.save_as_mainfile(filepath=target_file_new) + +# exits blender +bpy.ops.wm.quit_blender() diff --git a/models/extra/blender-scripting/blender-export.sh b/models/extra/blender-scripting/blender-export.sh index 5e78fdf..3c22c50 100755 --- a/models/extra/blender-scripting/blender-export.sh +++ b/models/extra/blender-scripting/blender-export.sh @@ -58,27 +58,6 @@ $blender ../../wolf.blend --python $PWD/lib/wolf.py $blender ../../zombie_baby.blend --python $PWD/lib/zombie_baby.py $blender ../../zombie.blend --python $PWD/lib/zombie.py -# SPECIAL CASES -# cow + mooshroom_baby -# cow + mooshroom -# drowned -# enderman -# horse + zombiehorse + skeltonhorse + mule + donkey baby -# horse + zombiehorse + skeltonhorse + mule + donkey -# llama_baby -# llama -# new_horse -# pig -# piglin -# puffer.fish -# sheep_baby -# sheep -# skeleton + skeleton_stray + wither_skeleton -# snowman -# vex -# vindicator + evoker + illusioner + villager + baby -# zombie_pigman + baby - # move all b3d files into exported folder mv --force ../../*.b3d $PWD/exported/ diff --git a/models/extra/blender-scripting/blender-special.sh b/models/extra/blender-scripting/blender-special.sh new file mode 100755 index 0000000..e46091d --- /dev/null +++ b/models/extra/blender-scripting/blender-special.sh @@ -0,0 +1,52 @@ +#!/bin/bash + +# https://www.youtube.com/watch?v=KNa5kJd2Epo + +# https://www.blender.org/download/previous-versions/ +# path to your blender2.97b executable +# mine is in my home folder +# make sure you have b3d exporter installed and enabled on that version +# every blend file needs to have shift+c (3d cursor in the middle on the floor) and inside Default tab for this to work properly +blender=$HOME/blender-2.79b-linux-glibc219-x86_64/blender + + +$blender ../../cow+mooshroom.blend --python $PWD/+/cow.py +$blender ../../cow+mooshroom.blend --python $PWD/+/mooshroom.py +$blender ../../cow+mooshroom_baby.blend --python $PWD/+/cow_baby.py +$blender ../../cow+mooshroom_baby.blend --python $PWD/+/mooshroom_baby.py +$blender ../../drowned.blend --python $PWD/+/drowned.py +$blender ../../enderman.blend --python $PWD/+/enderman.py +$blender ../../horse+zombiehorse+skeltonhorse+mule+donkey.blend --python $PWD/+/horse.py +$blender ../../horse+zombiehorse+skeltonhorse+mule+donkey_baby.blend --python $PWD/+/horse_baby.py +$blender ../../llama_baby.blend --python $PWD/+/llama_baby.py +$blender ../../llama.blend --python $PWD/+/llama.py +$blender ../../new_horse.blend --python $PWD/+/new_horse.py +$blender ../../pig.blend --python $PWD/+/pig.py +$blender ../../piglin.blend --python $PWD/+/piglin_mc.py +$blender ../../piglin.blend --python $PWD/+/piglin_pp.py +$blender ../../puffer.fish.blend --python $PWD/+/puffer.fish.py +$blender ../../sheep_baby.blend --python $PWD/+/sheep_baby.py +$blender ../../sheep.blend --python $PWD/+/sheep.py +$blender ../../skeleton+skeleton_stray+wither_skeleton.blend --python $PWD/+/skeleton_mc.py +$blender ../../skeleton+skeleton_stray+wither_skeleton.blend --python $PWD/+/skeleton_pp.py +$blender ../../skeleton+skeleton_stray+wither_skeleton.blend --python $PWD/+/wither_skeleton_pp.py +$blender ../../skeleton+skeleton_stray+wither_skeleton.blend --python $PWD/+/wither_skeleton_mc.py +$blender ../../skeleton+skeleton_stray+wither_skeleton.blend --python $PWD/+/skeleton_stray_mc.py +$blender ../../skeleton+skeleton_stray+wither_skeleton.blend --python $PWD/+/skeleton_stray_pp.py +$blender ../../snowman.blend --python $PWD/+/snowman.py +$blender ../../vex.blend --python $PWD/+/vex_pp.py +$blender ../../vex.blend --python $PWD/+/vex_mc.py +$blender ../../vindicator+evoker+illusioner+villager+baby.blend --python $PWD/+/villager.py +$blender ../../vindicator+evoker+illusioner+villager+baby.blend --python $PWD/+/vindicator_mc.py +$blender ../../vindicator+evoker+illusioner+villager+baby.blend --python $PWD/+/vindicator_pp.py +$blender ../../vindicator+evoker+illusioner+villager+baby.blend --python $PWD/+/illusioner_pp.py +$blender ../../vindicator+evoker+illusioner+villager+baby.blend --python $PWD/+/illusioner_mc.py +$blender ../../zombie_pigman+baby.blend --python $PWD/+/zombie_pigman_mc.py +$blender ../../zombie_pigman+baby.blend --python $PWD/+/zombie_pigman_pp.py + +# new_horse NEEDS FIX + +# move all b3d files into exported folder +mv --force ../../*.b3d $PWD/special.exported/ + +echo done everything diff --git a/models/extra/blender-scripting/special.exported/drowned.b3d b/models/extra/blender-scripting/special.exported/drowned.b3d new file mode 100644 index 0000000..e98f74a Binary files /dev/null and b/models/extra/blender-scripting/special.exported/drowned.b3d differ diff --git a/models/extra/blender-scripting/special.exported/enderman.b3d b/models/extra/blender-scripting/special.exported/enderman.b3d new file mode 100644 index 0000000..5c57e88 Binary files /dev/null and b/models/extra/blender-scripting/special.exported/enderman.b3d differ diff --git a/models/extra/blender-scripting/special.exported/horse.b3d b/models/extra/blender-scripting/special.exported/horse.b3d new file mode 100644 index 0000000..bb7eb67 Binary files /dev/null and b/models/extra/blender-scripting/special.exported/horse.b3d differ diff --git a/models/extra/blender-scripting/special.exported/horse_baby.b3d b/models/extra/blender-scripting/special.exported/horse_baby.b3d new file mode 100644 index 0000000..359aef6 Binary files /dev/null and b/models/extra/blender-scripting/special.exported/horse_baby.b3d differ diff --git a/models/extra/blender-scripting/special.exported/illusioner_mc.b3d b/models/extra/blender-scripting/special.exported/illusioner_mc.b3d new file mode 100644 index 0000000..221812a Binary files /dev/null and b/models/extra/blender-scripting/special.exported/illusioner_mc.b3d differ diff --git a/models/extra/blender-scripting/special.exported/illusioner_pp.b3d b/models/extra/blender-scripting/special.exported/illusioner_pp.b3d new file mode 100644 index 0000000..45444c9 Binary files /dev/null and b/models/extra/blender-scripting/special.exported/illusioner_pp.b3d differ diff --git a/models/extra/blender-scripting/special.exported/llama.b3d b/models/extra/blender-scripting/special.exported/llama.b3d new file mode 100644 index 0000000..37c76de Binary files /dev/null and b/models/extra/blender-scripting/special.exported/llama.b3d differ diff --git a/models/extra/blender-scripting/special.exported/llama_baby.b3d b/models/extra/blender-scripting/special.exported/llama_baby.b3d new file mode 100644 index 0000000..71e0db0 Binary files /dev/null and b/models/extra/blender-scripting/special.exported/llama_baby.b3d differ diff --git a/models/extra/blender-scripting/special.exported/new_horse.b3d b/models/extra/blender-scripting/special.exported/new_horse.b3d new file mode 100644 index 0000000..8366081 Binary files /dev/null and b/models/extra/blender-scripting/special.exported/new_horse.b3d differ diff --git a/models/extra/blender-scripting/special.exported/pig.b3d b/models/extra/blender-scripting/special.exported/pig.b3d new file mode 100644 index 0000000..f5ce4e9 Binary files /dev/null and b/models/extra/blender-scripting/special.exported/pig.b3d differ diff --git a/models/extra/blender-scripting/special.exported/piglin.b3d b/models/extra/blender-scripting/special.exported/piglin.b3d new file mode 100644 index 0000000..4c52036 Binary files /dev/null and b/models/extra/blender-scripting/special.exported/piglin.b3d differ diff --git a/models/extra/blender-scripting/special.exported/piglin_mc.b3d b/models/extra/blender-scripting/special.exported/piglin_mc.b3d new file mode 100644 index 0000000..6cfa486 Binary files /dev/null and b/models/extra/blender-scripting/special.exported/piglin_mc.b3d differ diff --git a/models/extra/blender-scripting/special.exported/piglin_pp.b3d b/models/extra/blender-scripting/special.exported/piglin_pp.b3d new file mode 100644 index 0000000..b0d346a Binary files /dev/null and b/models/extra/blender-scripting/special.exported/piglin_pp.b3d differ diff --git a/models/extra/blender-scripting/special.exported/puffer.fish.b3d b/models/extra/blender-scripting/special.exported/puffer.fish.b3d new file mode 100644 index 0000000..cc61d85 Binary files /dev/null and b/models/extra/blender-scripting/special.exported/puffer.fish.b3d differ diff --git a/models/extra/blender-scripting/special.exported/sheep.b3d b/models/extra/blender-scripting/special.exported/sheep.b3d new file mode 100644 index 0000000..66ce11d Binary files /dev/null and b/models/extra/blender-scripting/special.exported/sheep.b3d differ diff --git a/models/extra/blender-scripting/special.exported/sheep_baby.b3d b/models/extra/blender-scripting/special.exported/sheep_baby.b3d new file mode 100644 index 0000000..7c8427c Binary files /dev/null and b/models/extra/blender-scripting/special.exported/sheep_baby.b3d differ diff --git a/models/extra/blender-scripting/special.exported/skeleton_mc.b3d b/models/extra/blender-scripting/special.exported/skeleton_mc.b3d new file mode 100644 index 0000000..8b5ef4f Binary files /dev/null and b/models/extra/blender-scripting/special.exported/skeleton_mc.b3d differ diff --git a/models/extra/blender-scripting/special.exported/skeleton_pp.b3d b/models/extra/blender-scripting/special.exported/skeleton_pp.b3d new file mode 100644 index 0000000..80a1a51 Binary files /dev/null and b/models/extra/blender-scripting/special.exported/skeleton_pp.b3d differ diff --git a/models/extra/blender-scripting/special.exported/skeleton_stray_mc.b3d b/models/extra/blender-scripting/special.exported/skeleton_stray_mc.b3d new file mode 100644 index 0000000..ba922b4 Binary files /dev/null and b/models/extra/blender-scripting/special.exported/skeleton_stray_mc.b3d differ diff --git a/models/extra/blender-scripting/special.exported/skeleton_stray_pp.b3d b/models/extra/blender-scripting/special.exported/skeleton_stray_pp.b3d new file mode 100644 index 0000000..ceb9a5e Binary files /dev/null and b/models/extra/blender-scripting/special.exported/skeleton_stray_pp.b3d differ diff --git a/models/extra/blender-scripting/special.exported/snowman.b3d b/models/extra/blender-scripting/special.exported/snowman.b3d new file mode 100644 index 0000000..9c55fa9 Binary files /dev/null and b/models/extra/blender-scripting/special.exported/snowman.b3d differ diff --git a/models/extra/blender-scripting/special.exported/vex_mc.b3d b/models/extra/blender-scripting/special.exported/vex_mc.b3d new file mode 100644 index 0000000..3feeb71 Binary files /dev/null and b/models/extra/blender-scripting/special.exported/vex_mc.b3d differ diff --git a/models/extra/blender-scripting/special.exported/vex_pp.b3d b/models/extra/blender-scripting/special.exported/vex_pp.b3d new file mode 100644 index 0000000..abd8344 Binary files /dev/null and b/models/extra/blender-scripting/special.exported/vex_pp.b3d differ diff --git a/models/extra/blender-scripting/special.exported/villager.b3d b/models/extra/blender-scripting/special.exported/villager.b3d new file mode 100644 index 0000000..641963c Binary files /dev/null and b/models/extra/blender-scripting/special.exported/villager.b3d differ diff --git a/models/extra/blender-scripting/special.exported/vindicator_mc.b3d b/models/extra/blender-scripting/special.exported/vindicator_mc.b3d new file mode 100644 index 0000000..c4ac54c Binary files /dev/null and b/models/extra/blender-scripting/special.exported/vindicator_mc.b3d differ diff --git a/models/extra/blender-scripting/special.exported/vindicator_pp.b3d b/models/extra/blender-scripting/special.exported/vindicator_pp.b3d new file mode 100644 index 0000000..9212bd0 Binary files /dev/null and b/models/extra/blender-scripting/special.exported/vindicator_pp.b3d differ diff --git a/models/extra/blender-scripting/special.exported/wither_skeleton_mc.b3d b/models/extra/blender-scripting/special.exported/wither_skeleton_mc.b3d new file mode 100644 index 0000000..f97f0f3 Binary files /dev/null and b/models/extra/blender-scripting/special.exported/wither_skeleton_mc.b3d differ diff --git a/models/extra/blender-scripting/special.exported/wither_skeleton_pp.b3d b/models/extra/blender-scripting/special.exported/wither_skeleton_pp.b3d new file mode 100644 index 0000000..1d50e4a Binary files /dev/null and b/models/extra/blender-scripting/special.exported/wither_skeleton_pp.b3d differ diff --git a/models/extra/blender-scripting/special.exported/zombie_pigman_mc.b3d b/models/extra/blender-scripting/special.exported/zombie_pigman_mc.b3d new file mode 100644 index 0000000..5c19ee9 Binary files /dev/null and b/models/extra/blender-scripting/special.exported/zombie_pigman_mc.b3d differ diff --git a/models/extra/blender-scripting/special.exported/zombie_pigman_pp.b3d b/models/extra/blender-scripting/special.exported/zombie_pigman_pp.b3d new file mode 100644 index 0000000..5130c3e Binary files /dev/null and b/models/extra/blender-scripting/special.exported/zombie_pigman_pp.b3d differ diff --git a/models/horse + zombiehorse + skeltonhorse + mule + donkey.blend b/models/horse + zombiehorse + skeltonhorse + mule + donkey.blend deleted file mode 100644 index 3ce1259..0000000 Binary files a/models/horse + zombiehorse + skeltonhorse + mule + donkey.blend and /dev/null differ diff --git a/models/horse+zombiehorse+skeltonhorse+mule+donkey.blend b/models/horse+zombiehorse+skeltonhorse+mule+donkey.blend new file mode 100644 index 0000000..6873fd4 Binary files /dev/null and b/models/horse+zombiehorse+skeltonhorse+mule+donkey.blend differ diff --git a/models/horse + zombiehorse + skeltonhorse + mule + donkey baby.blend b/models/horse+zombiehorse+skeltonhorse+mule+donkey_baby.blend similarity index 50% rename from models/horse + zombiehorse + skeltonhorse + mule + donkey baby.blend rename to models/horse+zombiehorse+skeltonhorse+mule+donkey_baby.blend index d22972f..d56df52 100644 Binary files a/models/horse + zombiehorse + skeltonhorse + mule + donkey baby.blend and b/models/horse+zombiehorse+skeltonhorse+mule+donkey_baby.blend differ diff --git a/models/llama.blend b/models/llama.blend index 3f724f2..8795310 100644 Binary files a/models/llama.blend and b/models/llama.blend differ diff --git a/models/llama_baby.blend b/models/llama_baby.blend index 8b19246..a856667 100644 Binary files a/models/llama_baby.blend and b/models/llama_baby.blend differ diff --git a/models/new_horse.blend b/models/new_horse.blend old mode 100755 new mode 100644 index ee528bd..89aa961 Binary files a/models/new_horse.blend and b/models/new_horse.blend differ diff --git a/models/pig.blend b/models/pig.blend index 1085bed..b2d8598 100644 Binary files a/models/pig.blend and b/models/pig.blend differ diff --git a/models/piglin.blend b/models/piglin.blend index 14d2d4d..9c558ab 100644 Binary files a/models/piglin.blend and b/models/piglin.blend differ diff --git a/models/puffer.fish.blend b/models/puffer.fish.blend index e0afb5e..0891468 100644 Binary files a/models/puffer.fish.blend and b/models/puffer.fish.blend differ diff --git a/models/sheep.blend b/models/sheep.blend index ad258ad..23331d8 100644 Binary files a/models/sheep.blend and b/models/sheep.blend differ diff --git a/models/sheep_baby.blend b/models/sheep_baby.blend index 9701384..34010cb 100644 Binary files a/models/sheep_baby.blend and b/models/sheep_baby.blend differ diff --git a/models/skeleton + skeleton_stray + wither_skeleton.blend b/models/skeleton+skeleton_stray+wither_skeleton.blend similarity index 66% rename from models/skeleton + skeleton_stray + wither_skeleton.blend rename to models/skeleton+skeleton_stray+wither_skeleton.blend index c7763a8..bb6b570 100644 Binary files a/models/skeleton + skeleton_stray + wither_skeleton.blend and b/models/skeleton+skeleton_stray+wither_skeleton.blend differ diff --git a/models/snowman.blend b/models/snowman.blend index f9c8057..d155878 100644 Binary files a/models/snowman.blend and b/models/snowman.blend differ diff --git a/models/vex.blend b/models/vex.blend index bb98ccd..0a10781 100644 Binary files a/models/vex.blend and b/models/vex.blend differ diff --git a/models/vindicator + evoker + illusioner + villager + baby.blend b/models/vindicator+evoker+illusioner+villager+baby.blend similarity index 67% rename from models/vindicator + evoker + illusioner + villager + baby.blend rename to models/vindicator+evoker+illusioner+villager+baby.blend index 9000852..40aa5d1 100644 Binary files a/models/vindicator + evoker + illusioner + villager + baby.blend and b/models/vindicator+evoker+illusioner+villager+baby.blend differ diff --git a/models/zombie_pigman + baby.blend b/models/zombie_pigman+baby.blend similarity index 73% rename from models/zombie_pigman + baby.blend rename to models/zombie_pigman+baby.blend index 243da81..7789e29 100644 Binary files a/models/zombie_pigman + baby.blend and b/models/zombie_pigman+baby.blend differ