Created
July 15, 2013 10:40
-
-
Save PierrickKoch/5999070 to your computer and use it in GitHub Desktop.
Converted props/basic.blend to bpy script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # usage: blender -P {file} | |
| import os, sys, subprocess | |
| def ext_exec(cmd, python=None): | |
| if not python: | |
| python = 'python%i.%i'%(sys.version_info.major, sys.version_info.minor) | |
| return subprocess.getoutput('%s -c"%s"' % (python, cmd) ) | |
| def fix_python_path(python=None): | |
| pythonpath = ext_exec("import os,sys;print(os.pathsep.join(sys.path))") | |
| sys.path.extend(pythonpath.split(os.pathsep)) | |
| fix_python_path() | |
| from morse.builder.bpymorse import * | |
| from mathutils import Vector, Euler | |
| # warning: not an empty TODO AbstractComponent.append_meshes() | |
| # select_only(bpy.data.objects['CameraFP']) | |
| bpy.ops.object.add(type='CAMERA', location=Vector((5.949999809265137, -3.251711788720968e-08, 4.0)), rotation=Euler((1.570796251296997, 1.0972644304274581e-07, 1.570796251296997), 'XYZ')) | |
| bpy.context.object.name = 'CameraFP' | |
| bpy.context.object.game.physics_type = 'STATIC' | |
| game = bpy.context.object.game | |
| add_controller(type='PYTHON', name='Store degfault') | |
| game.controllers['Store degfault'].mode = "MODULE" | |
| game.controllers['Store degfault'].module = "view_camera.store_default" | |
| game.controllers['Store degfault'].name = "Store degfault" | |
| game.controllers['Store degfault'].type = "PYTHON" | |
| add_controller(type='PYTHON', name='MouseLook') | |
| game.controllers['MouseLook'].mode = "MODULE" | |
| game.controllers['MouseLook'].module = "view_camera.rotate" | |
| game.controllers['MouseLook'].name = "MouseLook" | |
| game.controllers['MouseLook'].type = "PYTHON" | |
| add_controller(type='PYTHON', name='KeyboardMove') | |
| game.controllers['KeyboardMove'].mode = "MODULE" | |
| game.controllers['KeyboardMove'].module = "view_camera.move" | |
| game.controllers['KeyboardMove'].name = "KeyboardMove" | |
| game.controllers['KeyboardMove'].type = "PYTHON" | |
| add_sensor(type='ALWAYS', name='onLoad') | |
| game.sensors['onLoad'].name = "onLoad" | |
| game.sensors['onLoad'].type = "ALWAYS" | |
| game.sensors['onLoad'].link(game.controllers['Store degfault']) | |
| add_sensor(type='MOUSE', name='Mouse') | |
| game.sensors['Mouse'].mouse_event = "MOVEMENT" | |
| game.sensors['Mouse'].name = "Mouse" | |
| game.sensors['Mouse'].type = "MOUSE" | |
| game.sensors['Mouse'].use_pulse = False | |
| game.sensors['Mouse'].link(game.controllers['MouseLook']) | |
| add_sensor(type='KEYBOARD', name='All_Keys') | |
| game.sensors['All_Keys'].key = "NONE" | |
| game.sensors['All_Keys'].log = "" | |
| game.sensors['All_Keys'].modifier_key_1 = "NONE" | |
| game.sensors['All_Keys'].modifier_key_2 = "NONE" | |
| game.sensors['All_Keys'].name = "All_Keys" | |
| game.sensors['All_Keys'].target = "" | |
| game.sensors['All_Keys'].type = "KEYBOARD" | |
| game.sensors['All_Keys'].use_all_keys = True | |
| game.sensors['All_Keys'].use_pulse_true_level = True | |
| game.sensors['All_Keys'].link(game.controllers['KeyboardMove']) | |
| game.sensors['All_Keys'].link(game.controllers['MouseLook']) | |
| properties(bpy.context.object, Sensitivity = 0.0010000000474974513, Speed = 0.10000000149011612) | |
| # warning: not an empty TODO AbstractComponent.append_meshes() | |
| # select_only(bpy.data.objects['CameraID_text']) | |
| bpy.ops.object.add(type='MESH', location=Vector((5.002999782562256, 0.33819472789764404, 4.151916980743408)), rotation=Euler((1.570796251296997, 8.940696716308594e-08, 1.570796251296997), 'XYZ')) | |
| bpy.context.object.name = 'CameraID_text' | |
| bpy.context.object.game.physics_type = 'NO_COLLISION' | |
| game = bpy.context.object.game | |
| properties(bpy.context.object, Text = "No camera selected") | |
| # warning: not an empty TODO AbstractComponent.append_meshes() | |
| # select_only(bpy.data.objects['Compass']) | |
| bpy.ops.object.add(type='MESH', location=Vector((-0.4717162251472473, -0.31274864077568054, 18.977027893066406)), rotation=Euler((0.0, 0.0, 0.0), 'XYZ')) | |
| bpy.context.object.name = 'Compass' | |
| bpy.context.object.game.physics_type = 'NO_COLLISION' | |
| game = bpy.context.object.game | |
| add_controller(type='PYTHON', name='Billboard') | |
| game.controllers['Billboard'].mode = "MODULE" | |
| game.controllers['Billboard'].module = "billboard.reset_rotation" | |
| game.controllers['Billboard'].name = "Billboard" | |
| game.controllers['Billboard'].show_expanded = True | |
| game.controllers['Billboard'].type = "PYTHON" | |
| add_controller(type='PYTHON', name='Display') | |
| game.controllers['Display'].mode = "MODULE" | |
| game.controllers['Display'].module = "billboard.display" | |
| game.controllers['Display'].name = "Display" | |
| game.controllers['Display'].show_expanded = True | |
| game.controllers['Display'].type = "PYTHON" | |
| add_sensor(type='ALWAYS', name='Always') | |
| game.sensors['Always'].name = "Always" | |
| game.sensors['Always'].show_expanded = True | |
| game.sensors['Always'].type = "ALWAYS" | |
| game.sensors['Always'].use_pulse_true_level = True | |
| game.sensors['Always'].link(game.controllers['Billboard']) | |
| add_sensor(type='KEYBOARD', name='1') | |
| game.sensors['1'].key = "ONE" | |
| game.sensors['1'].log = "" | |
| game.sensors['1'].modifier_key_1 = "LEFT_SHIFT" | |
| game.sensors['1'].modifier_key_2 = "NONE" | |
| game.sensors['1'].name = "1" | |
| game.sensors['1'].target = "" | |
| game.sensors['1'].type = "KEYBOARD" | |
| game.sensors['1'].use_all_keys = False | |
| game.sensors['1'].link(game.controllers['Display']) | |
| properties(bpy.context.object, Display = True) | |
| # warning: not an empty TODO AbstractComponent.append_meshes() | |
| # select_only(bpy.data.objects['HUD_plane']) | |
| bpy.ops.object.add(type='MESH', location=Vector((0.0, 0.0, 0.0)), rotation=Euler((0.0, 0.0, 0.0), 'XYZ')) | |
| bpy.context.object.name = 'HUD_plane' | |
| bpy.context.object.game.physics_type = 'NO_COLLISION' | |
| game = bpy.context.object.game | |
| add_actuator(type='PROPERTY', name='Toggle') | |
| game.actuators['Toggle'].mode = "TOGGLE" | |
| game.actuators['Toggle'].name = "Toggle" | |
| game.actuators['Toggle'].object_property = "" | |
| game.actuators['Toggle'].property = "Visible" | |
| game.actuators['Toggle'].type = "PROPERTY" | |
| game.actuators['Toggle'].value = "" | |
| add_actuator(type='VISIBILITY', name='Show') | |
| game.actuators['Show'].apply_to_children = True | |
| game.actuators['Show'].name = "Show" | |
| game.actuators['Show'].show_expanded = True | |
| game.actuators['Show'].type = "VISIBILITY" | |
| game.actuators['Show'].use_occlusion = False | |
| game.actuators['Show'].use_visible = True | |
| add_actuator(type='VISIBILITY', name='Hide') | |
| game.actuators['Hide'].apply_to_children = True | |
| game.actuators['Hide'].name = "Hide" | |
| game.actuators['Hide'].show_expanded = True | |
| game.actuators['Hide'].type = "VISIBILITY" | |
| game.actuators['Hide'].use_occlusion = False | |
| game.actuators['Hide'].use_visible = False | |
| add_controller(type='LOGIC_AND', name='And') | |
| game.controllers['And'].name = "And" | |
| game.controllers['And'].type = "LOGIC_AND" | |
| game.controllers['And'].link(actuator=game.actuators['Toggle']) | |
| add_controller(type='LOGIC_AND', name='And1') | |
| game.controllers['And1'].name = "And1" | |
| game.controllers['And1'].show_expanded = True | |
| game.controllers['And1'].type = "LOGIC_AND" | |
| game.controllers['And1'].link(actuator=game.actuators['Show']) | |
| add_controller(type='LOGIC_NAND', name='Nand') | |
| game.controllers['Nand'].name = "Nand" | |
| game.controllers['Nand'].show_expanded = True | |
| game.controllers['Nand'].type = "LOGIC_NAND" | |
| game.controllers['Nand'].link(actuator=game.actuators['Hide']) | |
| add_sensor(type='KEYBOARD', name='H_KEY') | |
| game.sensors['H_KEY'].key = "H" | |
| game.sensors['H_KEY'].log = "" | |
| game.sensors['H_KEY'].modifier_key_1 = "NONE" | |
| game.sensors['H_KEY'].modifier_key_2 = "NONE" | |
| game.sensors['H_KEY'].name = "H_KEY" | |
| game.sensors['H_KEY'].target = "" | |
| game.sensors['H_KEY'].type = "KEYBOARD" | |
| game.sensors['H_KEY'].use_all_keys = False | |
| game.sensors['H_KEY'].link(game.controllers['And']) | |
| add_sensor(type='PROPERTY', name='Visible') | |
| game.sensors['Visible'].evaluation_type = "PROPEQUAL" | |
| game.sensors['Visible'].name = "Visible" | |
| game.sensors['Visible'].property = "Visible" | |
| game.sensors['Visible'].show_expanded = True | |
| game.sensors['Visible'].type = "PROPERTY" | |
| game.sensors['Visible'].value = "True" | |
| game.sensors['Visible'].value_max = "" | |
| game.sensors['Visible'].value_min = "True" | |
| game.sensors['Visible'].link(game.controllers['And1']) | |
| game.sensors['Visible'].link(game.controllers['Nand']) | |
| properties(bpy.context.object, Visible = False) | |
| # warning: not an empty TODO AbstractComponent.append_meshes() | |
| # select_only(bpy.data.objects['Keys_text']) | |
| bpy.ops.object.add(type='MESH', location=Vector((-0.8100001811981201, 0.309999942779541, 0.0)), rotation=Euler((0.0, 0.0, 0.0), 'XYZ')) | |
| bpy.context.object.name = 'Keys_text' | |
| bpy.context.object.game.physics_type = 'NO_COLLISION' | |
| game = bpy.context.object.game | |
| add_controller(type='PYTHON', name='And') | |
| game.controllers['And'].mode = "MODULE" | |
| game.controllers['And'].module = "hud_text.change_text" | |
| game.controllers['And'].name = "And" | |
| game.controllers['And'].show_expanded = True | |
| game.controllers['And'].type = "PYTHON" | |
| add_sensor(type='ALWAYS', name='Keyboard') | |
| game.sensors['Keyboard'].name = "Keyboard" | |
| game.sensors['Keyboard'].show_expanded = True | |
| game.sensors['Keyboard'].type = "ALWAYS" | |
| game.sensors['Keyboard'].link(game.controllers['And']) | |
| properties(bpy.context.object, Text = "HUD text") | |
| # warning: not an empty TODO AbstractComponent.append_meshes() | |
| # select_only(bpy.data.objects['Scene_Script_Holder']) | |
| bpy.ops.object.add(type='EMPTY', location=Vector((0.0, 0.0, 10.828476905822754)), rotation=Euler((0.0, 0.0, 0.0), 'XYZ')) | |
| bpy.context.object.name = 'Scene_Script_Holder' | |
| bpy.context.object.game.physics_type = 'NO_COLLISION' | |
| game = bpy.context.object.game | |
| add_actuator(type='SCENE', name='Set_Camera') | |
| game.actuators['Set_Camera'].mode = "CAMERA" | |
| game.actuators['Set_Camera'].name = "Set_Camera" | |
| game.actuators['Set_Camera'].type = "SCENE" | |
| add_actuator(type='GAME', name='Quit_sim') | |
| game.actuators['Quit_sim'].filename = "" | |
| game.actuators['Quit_sim'].mode = "QUIT" | |
| game.actuators['Quit_sim'].name = "Quit_sim" | |
| game.actuators['Quit_sim'].type = "GAME" | |
| add_actuator(type='GAME', name='Restart_sim') | |
| game.actuators['Restart_sim'].filename = "" | |
| game.actuators['Restart_sim'].mode = "RESTART" | |
| game.actuators['Restart_sim'].name = "Restart_sim" | |
| game.actuators['Restart_sim'].type = "GAME" | |
| add_controller(type='LOGIC_AND', name='cont') | |
| game.controllers['cont'].name = "cont" | |
| game.controllers['cont'].type = "LOGIC_AND" | |
| game.controllers['cont'].link(actuator=game.actuators['Set_Camera']) | |
| add_controller(type='PYTHON', name='Path') | |
| game.controllers['Path'].mode = "MODULE" | |
| game.controllers['Path'].module = "setup_path.test" | |
| game.controllers['Path'].name = "Path" | |
| game.controllers['Path'].type = "PYTHON" | |
| game.controllers['Path'].use_priority = True | |
| game.controllers['Path'].link(actuator=game.actuators['Quit_sim']) | |
| add_controller(type='PYTHON', name='Initialize') | |
| game.controllers['Initialize'].mode = "MODULE" | |
| game.controllers['Initialize'].module = "main.init" | |
| game.controllers['Initialize'].name = "Initialize" | |
| game.controllers['Initialize'].type = "PYTHON" | |
| game.controllers['Initialize'].link(actuator=game.actuators['Quit_sim']) | |
| add_controller(type='PYTHON', name='Finalize') | |
| game.controllers['Finalize'].mode = "MODULE" | |
| game.controllers['Finalize'].module = "main.finish" | |
| game.controllers['Finalize'].name = "Finalize" | |
| game.controllers['Finalize'].type = "PYTHON" | |
| game.controllers['Finalize'].link(actuator=game.actuators['Quit_sim']) | |
| add_controller(type='PYTHON', name='Switch_Camera') | |
| game.controllers['Switch_Camera'].mode = "MODULE" | |
| game.controllers['Switch_Camera'].module = "main.switch_camera" | |
| game.controllers['Switch_Camera'].name = "Switch_Camera" | |
| game.controllers['Switch_Camera'].type = "PYTHON" | |
| add_controller(type='LOGIC_AND', name='Fast_quit') | |
| game.controllers['Fast_quit'].name = "Fast_quit" | |
| game.controllers['Fast_quit'].type = "LOGIC_AND" | |
| game.controllers['Fast_quit'].link(actuator=game.actuators['Quit_sim']) | |
| add_controller(type='PYTHON', name='Admin') | |
| game.controllers['Admin'].mode = "MODULE" | |
| game.controllers['Admin'].module = "main.simulation_main" | |
| game.controllers['Admin'].name = "Admin" | |
| game.controllers['Admin'].type = "PYTHON" | |
| game.controllers['Admin'].link(actuator=game.actuators['Quit_sim']) | |
| add_controller(type='PYTHON', name='Restart') | |
| game.controllers['Restart'].mode = "MODULE" | |
| game.controllers['Restart'].module = "main.restart" | |
| game.controllers['Restart'].name = "Restart" | |
| game.controllers['Restart'].type = "PYTHON" | |
| game.controllers['Restart'].link(actuator=game.actuators['Restart_sim']) | |
| add_controller(type='PYTHON', name='Import_path_script') | |
| game.controllers['Import_path_script'].name = "Import_path_script" | |
| game.controllers['Import_path_script'].show_expanded = True | |
| game.controllers['Import_path_script'].type = "PYTHON" | |
| add_sensor(type='ALWAYS', name='onLoad') | |
| game.sensors['onLoad'].name = "onLoad" | |
| game.sensors['onLoad'].type = "ALWAYS" | |
| game.sensors['onLoad'].link(game.controllers['cont']) | |
| game.sensors['onLoad'].link(game.controllers['Path']) | |
| add_sensor(type='PROPERTY', name='paths_ok') | |
| game.sensors['paths_ok'].evaluation_type = "PROPEQUAL" | |
| game.sensors['paths_ok'].name = "paths_ok" | |
| game.sensors['paths_ok'].property = "paths_ok" | |
| game.sensors['paths_ok'].type = "PROPERTY" | |
| game.sensors['paths_ok'].value = "True" | |
| game.sensors['paths_ok'].value_max = "" | |
| game.sensors['paths_ok'].value_min = "True" | |
| game.sensors['paths_ok'].link(game.controllers['Initialize']) | |
| add_sensor(type='KEYBOARD', name='ESC_KEY') | |
| game.sensors['ESC_KEY'].key = "ESC" | |
| game.sensors['ESC_KEY'].log = "" | |
| game.sensors['ESC_KEY'].modifier_key_1 = "NONE" | |
| game.sensors['ESC_KEY'].modifier_key_2 = "NONE" | |
| game.sensors['ESC_KEY'].name = "ESC_KEY" | |
| game.sensors['ESC_KEY'].target = "" | |
| game.sensors['ESC_KEY'].type = "KEYBOARD" | |
| game.sensors['ESC_KEY'].use_all_keys = False | |
| game.sensors['ESC_KEY'].link(game.controllers['Finalize']) | |
| add_sensor(type='KEYBOARD', name='F9_KEY') | |
| game.sensors['F9_KEY'].key = "F9" | |
| game.sensors['F9_KEY'].log = "" | |
| game.sensors['F9_KEY'].modifier_key_1 = "NONE" | |
| game.sensors['F9_KEY'].modifier_key_2 = "NONE" | |
| game.sensors['F9_KEY'].name = "F9_KEY" | |
| game.sensors['F9_KEY'].target = "" | |
| game.sensors['F9_KEY'].type = "KEYBOARD" | |
| game.sensors['F9_KEY'].use_all_keys = False | |
| game.sensors['F9_KEY'].link(game.controllers['Switch_Camera']) | |
| add_sensor(type='KEYBOARD', name='F12_KEY') | |
| game.sensors['F12_KEY'].key = "F12" | |
| game.sensors['F12_KEY'].log = "" | |
| game.sensors['F12_KEY'].modifier_key_1 = "NONE" | |
| game.sensors['F12_KEY'].modifier_key_2 = "NONE" | |
| game.sensors['F12_KEY'].name = "F12_KEY" | |
| game.sensors['F12_KEY'].target = "" | |
| game.sensors['F12_KEY'].type = "KEYBOARD" | |
| game.sensors['F12_KEY'].use_all_keys = False | |
| game.sensors['F12_KEY'].link(game.controllers['Fast_quit']) | |
| add_sensor(type='ALWAYS', name='Constant') | |
| game.sensors['Constant'].name = "Constant" | |
| game.sensors['Constant'].type = "ALWAYS" | |
| game.sensors['Constant'].use_pulse_true_level = True | |
| game.sensors['Constant'].link(game.controllers['Admin']) | |
| add_sensor(type='KEYBOARD', name='F11_KEY') | |
| game.sensors['F11_KEY'].key = "F11" | |
| game.sensors['F11_KEY'].log = "" | |
| game.sensors['F11_KEY'].modifier_key_1 = "NONE" | |
| game.sensors['F11_KEY'].modifier_key_2 = "NONE" | |
| game.sensors['F11_KEY'].name = "F11_KEY" | |
| game.sensors['F11_KEY'].target = "" | |
| game.sensors['F11_KEY'].type = "KEYBOARD" | |
| game.sensors['F11_KEY'].use_all_keys = False | |
| game.sensors['F11_KEY'].link(game.controllers['Restart']) | |
| properties(bpy.context.object, paths_ok = True, UTMZOffset = 0.0, UTMXOffset = 0.0, UTMYOffset = 0.0, environment_file = "", Temperature = "15.0") | |
| # warning: not an empty TODO AbstractComponent.append_meshes() | |
| # select_only(bpy.data.objects['Screen']) | |
| bpy.ops.object.add(type='MESH', location=Vector((4.800000190734863, 0.5, 4.300000190734863)), rotation=Euler((1.5707963705062866, 7.549790126404332e-08, 1.5707963705062866), 'XYZ')) | |
| bpy.context.object.name = 'Screen' | |
| bpy.context.object.game.physics_type = 'NO_COLLISION' | |
| game = bpy.context.object.game | |
| add_actuator(type='PROPERTY', name='Toggle') | |
| game.actuators['Toggle'].mode = "TOGGLE" | |
| game.actuators['Toggle'].name = "Toggle" | |
| game.actuators['Toggle'].object_property = "" | |
| game.actuators['Toggle'].property = "Visible" | |
| game.actuators['Toggle'].type = "PROPERTY" | |
| game.actuators['Toggle'].value = "" | |
| add_actuator(type='VISIBILITY', name='Show') | |
| game.actuators['Show'].apply_to_children = True | |
| game.actuators['Show'].name = "Show" | |
| game.actuators['Show'].show_expanded = True | |
| game.actuators['Show'].type = "VISIBILITY" | |
| game.actuators['Show'].use_occlusion = False | |
| game.actuators['Show'].use_visible = True | |
| add_actuator(type='VISIBILITY', name='Hide') | |
| game.actuators['Hide'].apply_to_children = True | |
| game.actuators['Hide'].name = "Hide" | |
| game.actuators['Hide'].show_expanded = True | |
| game.actuators['Hide'].type = "VISIBILITY" | |
| game.actuators['Hide'].use_occlusion = False | |
| game.actuators['Hide'].use_visible = False | |
| add_controller(type='LOGIC_AND', name='And') | |
| game.controllers['And'].name = "And" | |
| game.controllers['And'].type = "LOGIC_AND" | |
| game.controllers['And'].link(actuator=game.actuators['Toggle']) | |
| add_controller(type='LOGIC_AND', name='And1') | |
| game.controllers['And1'].name = "And1" | |
| game.controllers['And1'].show_expanded = True | |
| game.controllers['And1'].type = "LOGIC_AND" | |
| game.controllers['And1'].link(actuator=game.actuators['Show']) | |
| add_controller(type='LOGIC_NAND', name='Nand') | |
| game.controllers['Nand'].name = "Nand" | |
| game.controllers['Nand'].show_expanded = True | |
| game.controllers['Nand'].type = "LOGIC_NAND" | |
| game.controllers['Nand'].link(actuator=game.actuators['Hide']) | |
| add_sensor(type='KEYBOARD', name='V_KEY') | |
| game.sensors['V_KEY'].key = "V" | |
| game.sensors['V_KEY'].log = "" | |
| game.sensors['V_KEY'].modifier_key_1 = "NONE" | |
| game.sensors['V_KEY'].modifier_key_2 = "NONE" | |
| game.sensors['V_KEY'].name = "V_KEY" | |
| game.sensors['V_KEY'].target = "" | |
| game.sensors['V_KEY'].type = "KEYBOARD" | |
| game.sensors['V_KEY'].use_all_keys = False | |
| game.sensors['V_KEY'].link(game.controllers['And']) | |
| add_sensor(type='PROPERTY', name='Visible') | |
| game.sensors['Visible'].evaluation_type = "PROPEQUAL" | |
| game.sensors['Visible'].name = "Visible" | |
| game.sensors['Visible'].property = "Visible" | |
| game.sensors['Visible'].show_expanded = True | |
| game.sensors['Visible'].type = "PROPERTY" | |
| game.sensors['Visible'].value = "True" | |
| game.sensors['Visible'].value_max = "" | |
| game.sensors['Visible'].value_min = "True" | |
| game.sensors['Visible'].link(game.controllers['And1']) | |
| game.sensors['Visible'].link(game.controllers['Nand']) | |
| properties(bpy.context.object, DisplayCamera = "CameraMain", Visible = False) | |
| # warning: not an empty TODO AbstractComponent.append_meshes() | |
| # select_only(bpy.data.objects['Screen_frame']) | |
| bpy.ops.object.add(type='MESH', location=Vector((4.799000263214111, 0.5, 4.299999713897705)), rotation=Euler((1.5707963705062866, 1.1920928955078125e-07, 1.5707963705062866), 'XYZ')) | |
| bpy.context.object.name = 'Screen_frame' | |
| bpy.context.object.game.physics_type = 'NO_COLLISION' | |
| game = bpy.context.object.game | |
| # warning: not an empty TODO AbstractComponent.append_meshes() | |
| # select_only(bpy.data.objects['Title_text']) | |
| bpy.ops.object.add(type='MESH', location=Vector((-0.6000000238418579, 0.4300001561641693, 0.0)), rotation=Euler((0.0, 0.0, 0.0), 'XYZ')) | |
| bpy.context.object.name = 'Title_text' | |
| bpy.context.object.game.physics_type = 'NO_COLLISION' | |
| game = bpy.context.object.game | |
| properties(bpy.context.object, Text = "MORSE keyboard shortcuts") | |
| bpy.data.objects['Compass'].parent = bpy.data.objects['CameraFP'] | |
| bpy.data.objects['HUD_plane'].parent = bpy.data.objects['CameraFP'] | |
| bpy.data.objects['Screen'].parent = bpy.data.objects['CameraFP'] | |
| bpy.data.objects['Keys_text'].parent = bpy.data.objects['HUD_plane'] | |
| bpy.data.objects['Title_text'].parent = bpy.data.objects['HUD_plane'] | |
| bpy.data.objects['CameraID_text'].parent = bpy.data.objects['Screen'] | |
| bpy.data.objects['Screen_frame'].parent = bpy.data.objects['Screen'] | |
| new_text() | |
| text = get_last_text() | |
| text.name = 'Info.txt' | |
| text.write("###########################################\n# Multi Open Robots Simulation Engine #\n###########################################\n\n\nCamera Control\n--------------\n\t\n\tDisplay help: Press the H key\n\tToggle screen on/off: Press the V key\n\t\n\tCamera controls:\n\t\tHold left CTRL + Mouse -> Look around\n\t\tW/Z, S keys -> Move forward, backward\n\t\tA/Q, D keys -> Move to the sides\n\t\tR, F keys -> Move up, down\n\t\t\n\tThe speed and sensitivity of movement can be changed by editing the Logic Properties of the CameraFP object\n\t\n\t\n\nDefault props file\n-----------------\n\nIncludes:\n\t- the Scene_Script_Holder object\n\t- the CameraFP object\n\t- the Compass object\n\t- HUD help messages\n\t- the basic scripts:\n\t\t- to initialize PYTHONPATH\n\t\t- to configure components") | |
| new_text() | |
| text = get_last_text() | |
| text.name = 'setup_path.py' | |
| text.write("import sys, os\n\n\"\"\" Check that MORSE libraries are correctly installed\n\nSearches the PYTHONPATH variable for the required directories: $ORS_ROOT and $ORS_ROOT/morse/blender\n\"\"\"\n\ndef test(contr):\n print (\"==============================\")\n print (\"Welcome to the MORSE simulator\")\n print (\"==============================\")\n #print (\"\\nUsing path: {0}\\n\".format(sys.path))\n\n blender_dir = 'morse/blender'\n\n for dir in sys.path:\n if os.path.exists(os.path.join(dir, \"morse/blender/main.py\")):\n sys.path.append(os.path.join(dir, \"morse/blender\"))\n sys.path.append(os.path.join(dir, \"morse/blender/human_interaction\"))\n return\n \n print (\"MORSE ERROR: could not find the MORSE libraries. Please run 'morse check' from the command line to solve this issue.\")\n print (\"Exiting the simulation!\")\n quitActuator = contr.actuators['Quit_sim']\n contr.activate(quitActuator)") | |
| # over |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment