Beispiel #1
0
    def execute(self, context):
        if not arm.utils.check_saved(self):
            return {"CANCELLED"}

        if not arm.utils.check_sdkpath(self):
            return {"CANCELLED"}

        if not arm.utils.check_engine(self):
            return {"CANCELLED"}

        make_renderer.check_default()

        if state.playproc != None:
            make.stop_project()
        if bpy.data.worlds['Arm'].arm_play_runtime != 'Krom':
            bpy.data.worlds['Arm'].arm_play_runtime = 'Krom'
        rpdat = arm.utils.get_rp()
        if rpdat.rp_rendercapture == False:
            rpdat.rp_rendercapture = True
        if rpdat.rp_antialiasing != 'TAA':
            rpdat.rp_antialiasing = 'TAA'
        assets.invalidate_enabled = False
        make.get_render_result()
        assets.invalidate_enabled = True
        return {'FINISHED'}
Beispiel #2
0
    def execute(self, context):
        if state.compileproc != None:
            return {"CANCELLED"}

        if not arm.utils.check_saved(self):
            return {"CANCELLED"}

        if not arm.utils.check_camera(self):
            return {"CANCELLED"}

        if not arm.utils.check_sdkpath(self):
            return {"CANCELLED"}

        if context.area == None:
            return {"CANCELLED"}

        make_renderer.check_default()

        assets.invalidate_enabled = False
        if state.playproc == None and state.krom_running == False:
            if context.area.type != 'VIEW_3D':
                return {"CANCELLED"}
            # Cancel viewport render
            for space in context.area.spaces:
                if space.type == 'VIEW_3D':
                    if space.viewport_shade == 'RENDERED':
                        space.viewport_shade = 'SOLID'
                    break
            make.play_project(True)
        else:
            make.play_project(True)
        assets.invalidate_enabled = True
        return {'FINISHED'}
Beispiel #3
0
    def execute(self, context):
        if not arm.utils.check_saved(self):
            return {"CANCELLED"}

        if not arm.utils.check_sdkpath(self):
            return {"CANCELLED"}

        if not arm.utils.check_engine(self):
            return {"CANCELLED"}

        arm.utils.check_projectpath(self)

        make_renderer.check_default()

        wrd = bpy.data.worlds['Arm']
        item = wrd.arm_exporterlist[wrd.arm_exporterlist_index]
        if item.arm_project_rp == '':
            item.arm_project_rp = wrd.arm_rplist[wrd.arm_rplist_index].name
        # Assume unique rp names
        rplist_index = wrd.arm_rplist_index
        for i in range(0, len(wrd.arm_rplist)):
            if wrd.arm_rplist[i].name == item.arm_project_rp:
                wrd.arm_rplist_index = i
                break
        state.target = item.arm_project_target
        state.is_export = True
        assets.invalidate_shader_cache(None, None)
        assets.invalidate_enabled = False
        make.build_project()
        make.compile_project(watch=True)
        state.is_export = False
        wrd.arm_rplist_index = rplist_index
        assets.invalidate_enabled = True
        return {'FINISHED'}
Beispiel #4
0
    def execute(self, context):
        if not arm.utils.check_saved(self):
            return {"CANCELLED"}

        if not arm.utils.check_sdkpath(self):
            return {"CANCELLED"}

        if not arm.utils.check_engine(self):
            return {"CANCELLED"}

        self.report({'INFO'}, 'Publishing project, check console for details.')

        arm.utils.check_projectpath(self)

        make_renderer.check_default()

        wrd = bpy.data.worlds['Arm']
        item = wrd.arm_exporterlist[wrd.arm_exporterlist_index]
        if item.arm_project_rp == '':
            item.arm_project_rp = wrd.arm_rplist[wrd.arm_rplist_index].name
        # Assume unique rp names
        rplist_index = wrd.arm_rplist_index
        for i in range(0, len(wrd.arm_rplist)):
            if wrd.arm_rplist[i].name == item.arm_project_rp:
                wrd.arm_rplist_index = i
                break

        make.clean_project()
        state.target = item.arm_project_target
        state.is_export = True
        assets.invalidate_enabled = False
        make.build_project(is_publish=True)
        make.compile_project(watch=True)
        state.is_export = False
        wrd.arm_rplist_index = rplist_index
        assets.invalidate_enabled = True
        target_name = make_utils.get_kha_target(state.target)
        files_path = arm.utils.get_fp_build() + '/' + target_name
        if target_name == 'html5':
            print('HTML5 files are being exported to ' + files_path)
        elif target_name == 'ios' or target_name == 'osx':  # TODO: to macos
            print('XCode project files are being exported to ' + files_path +
                  '-build')
        elif target_name == 'windows':
            print('VisualStudio 2017 project files are being exported to ' +
                  files_path + '-build')
        elif target_name == 'windowsapp':
            print('VisualStudio 2017 project files are being exported to ' +
                  files_path + '-build')
        elif target_name == 'android-native':
            print('Android Studio project files are being exported to ' +
                  files_path + '-build/' +
                  arm.utils.safestr(wrd.arm_project_name))
        else:
            print('Makefiles are being exported to ' + files_path + '-build')
        return {'FINISHED'}
Beispiel #5
0
    def execute(self, context):
        if state.compileproc != None:
            return {"CANCELLED"}

        if not arm.utils.check_saved(self):
            return {"CANCELLED"}

        if not arm.utils.check_camera(self):
            return {"CANCELLED"}

        if not arm.utils.check_sdkpath(self):
            return {"CANCELLED"}

        make_renderer.check_default()

        assets.invalidate_enabled = False
        make.play_project(False)
        assets.invalidate_enabled = True
        return {'FINISHED'}
Beispiel #6
0
    def execute(self, context):
        if not arm.utils.check_saved(self):
            return {"CANCELLED"}

        if not arm.utils.check_sdkpath(self):
            return {"CANCELLED"}

        if not arm.utils.check_engine(self):
            return {"CANCELLED"}

        make_renderer.check_default()

        state.target = make.runtime_to_target(in_viewport=False)
        state.is_export = False
        assets.invalidate_enabled = False
        make.build_project()
        make.compile_project(watch=True)
        assets.invalidate_enabled = True
        return {'FINISHED'}
Beispiel #7
0
    def execute(self, context):
        if state.compileproc != None:
            return {"CANCELLED"}

        if not arm.utils.check_saved(self):
            return {"CANCELLED"}

        if not arm.utils.check_sdkpath(self):
            return {"CANCELLED"}

        if not arm.utils.check_engine(self):
            return {"CANCELLED"}

        make_renderer.check_default()

        rpdat = arm.utils.get_rp()
        if rpdat.rp_rendercapture == True:
            rpdat.rp_rendercapture = False

        state.is_export = False
        assets.invalidate_enabled = False
        make.play_project(False)
        assets.invalidate_enabled = True
        return {'FINISHED'}