def add_logic(self): rigid_body_list = blender_utils.create_list_rigid_bodies() ### Start by clearing all logic from scene directory = blender_utils.get_directory('bpy') blender_utils.run_bpy_script(directory, "remove_all_logic.py") ### Start by deselecting all objects bpy.ops.object.select_all(action='DESELECT') self.add_general_logic(rigid_body_list) self.add_main_empty_logic() self.add_camera_navigation_logic()
def save_game_remove_logic(self): bpy.ops.wm.addon_enable(module="game_engine_save_as_runtime") bpy.context.screen.scene = self.main_scene bpy.ops.wm.save_as_runtime( filepath=blender_utils.get_directory('blender') + '/annotation scenes/' + bpy.path.basename(bpy.context.blend_data.filepath).replace( ".blend", "-" + self.suffix + ".blend")) directory = blender_utils.get_directory('bpy') blender_utils.run_bpy_script(directory, "remove_all_logic.py")
def prepare_scene(): bpy_scripts_directory = blender_utils.get_directory('bpy') edits_scripts_directory = blender_utils.get_directory('edits') blender_utils.link_scripts(bpy_scripts_directory) blender_utils.link_scripts(edits_scripts_directory) #blender_utils.run_bpy_script(directory,"edit_physics.py") blender_utils.run_bpy_script(bpy_scripts_directory, "edit_rendering_and_settings.py") blender_utils.run_bpy_script(bpy_scripts_directory, "create_highlights.py") blender_utils.run_bpy_script(bpy_scripts_directory, "remove_all_logic.py")