12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- import bpy
- scene = bpy.context.scene
- print("Setting length/rotation units...")
- scene.unit_settings.system = 'METRIC'
- scene.unit_settings.scale_length = 0.01
- bpy.ops.scene.units_length_preset_add(name="Galaxy Unit")
- scene.unit_settings.system_rotation = 'DEGREES'
- scene.unit_settings.use_separate = False
- print("Scaling 3D View grid...")
- for area in bpy.context.screen.areas:
- if (area.type == 'VIEW_3D'):
- view_3d_area = area.spaces.active
- view_3d_area.grid_scale = 0.01
- view_3d_area.grid_lines = 400
- view_3d_area.show_axis_x = True
- view_3d_area.show_axis_y = True
- view_3d_area.show_axis_z = True
- view_3d_area.clip_start = 0.001
- view_3d_area.clip_end = 1000000
- break
- bpy.ops.object.select_all(action='SELECT')
- bpy.ops.object.delete()
- print("Importing Mario's Model...")
- blenxy_path = bpy.utils.user_resource('SCRIPTS', "startup/bl_app_templates_user/blenxy/")
- bpy.ops.wm.collada_import(filepath = blenxy_path + "Mario.dae")
- Mario = bpy.data.objects.get("Mario")
- Mario.select = True
- print("Setting SMG Axis Reference...")
- Mario.select = True
- override = bpy.context.copy()
- override['area'] = area
- bpy.ops.transform.create_orientation(override, name = "SMG Axis", use = True)
- bpy.context.scene.orientations[-1].matrix = [[ 1.0, 0.0, 0.0],
- [ 0.0, 0.0, 1.0],
- [ 0.0, -1.0, 0.0]]
- print("Adjusting 3D Viewport camera location...")
- view_3d_area.region_3d.view_rotation = (0.8001, 0.4619, 0.1913, 0.3314)
- view_3d_area.region_3d.view_distance = 4
- print("Extra stuff to set...")
- bpy.context.scene.world.light_settings.use_environment_light = True
- bpy.context.scene.render.fps = 60
- bpy.context.scene.render.fps_base = 1.001
- bpy.data.scenes["Scene"].frame_start = 0
- bpy.data.scenes["Scene"].frame_current = 0
- print("Done with the basic settings!\n")
|