def run():
    """
    This run statement is what's executed when your button is pressed in blender.
    :return:
    """
    renanme_action()

    write_anim()
    alc.save_file()
def run():
    """
    This run statement is what's executed when your button is pressed in blender.
    :return:
    """
    collection = bpy.context.collection
    light_task = export_to_task(collection.name, task='light')
    alc.save_file_as(light_task.path_root)
    bpy.ops.object.build()
    collection.name = bpy.context.scene.name
    alc.save_file()
예제 #3
0
def open_selected_library():
    obj = bpy.context.active_object
    from cgl.plugins.blender.msd import path_object_from_source_path
    library = obj['source_path']


    lumber_object = path_object_from_source_path(library)

    alc.save_file()

    import os
    os.startfile(lumber_object.copy(context ='source').path_root, 'open')
예제 #4
0
def run():

    """
    This run statement is what's executed when your button is pressed in blender.
    :return:
    """

    path_object = utils.create_task_on_asset('shd')
    jsonFile = path_object.copy(ext='json')
    outFile = path_object.copy(ext='json').path_root
    print(path_object.path_root)
    save_json(outFile, data=utils.get_materials_dictionary())
    alc.save_file_as(path_object.copy(set_proper_filename=True).path_root)
    bpy.ops.object.build()
    alc.save_file()
    alc.confirm_prompt(message='Shaders Exported !!')
예제 #5
0
def open_selected_library():
    obj = bpy.context.active_object


    if 'proxy' in obj.name:
        name = obj.name.split('_')[0]
    else:
        if '.' in obj.name:
            name = obj.name.split('.')[0]
        else:

            name = obj.name

    library = bpy.data.collections[name].library
    libraryPath = bpy.path.abspath(library.filepath)
    filename = Path(bpy.path.abspath(libraryPath)).__str__()

    lumber_object = alc.PathObject(filename).copy(context = 'source')
    alc.save_file()
    import os
    os.startfile(lumber_object.path_root, 'open')
예제 #6
0
    def run(self):
        """
        script to be executed when the preflight is run.

        If the preflight is successful:
        self.pass_check('Message about a passed Check')

        if the preflight fails:
        self.fail_check('Message about a failed check')
        :return:
        """
        print('Publish')

        # alc.save_file()
        current_scene = alc.scene_object()
        render_file = current_scene.copy(context='render')
        current_source = current_scene.copy(context='source',
                                            filename=None,
                                            ext=None).path_root
        current_render = current_scene.copy(context='render',
                                            filename=None,
                                            ext=None).path_root

        bpy.ops.file.make_paths_relative()
        if os.path.isdir(current_render):
            if current_scene.filename not in os.listdir(current_render):
                alc.save_file_as(render_file.path_root)
            else:
                os.remove(render_file.path_root)
                alc.save_file_as(render_file.path_root)
        else:
            os.makedirs(current_render)
            alc.save_file_as(render_file.path_root)

        alc.open_file(current_scene.copy(context='source').path_root)
        bpy.ops.file.make_paths_relative()
        alc.save_file()
        bpy.ops.object.copy_latest_low()
        self.pass_check('Check Passed')
        self.final_check()