Esempio n. 1
0
    def open_asset_scene(self):

        # Get Asset Object
        self.get_asset_data()

        asset_file_path = file_path.EveFilePath()
        file_type = entities.EveFile.file_types['asset_hip']
        asset_file_path.build_path_asset_hip(file_type, self.asset_data.asset_type, self.asset_data.asset.name, '001')
        asset_file_path.build_last_file_version()

        hou.hipFile.load(asset_file_path.path)
Esempio n. 2
0
def save_next_version():

    scene_path = hou.hipFile.path()

    if scene_path:
        scene_file = file_path.EveFilePath(scene_path)
        scene_file.build_next_file_version()
        scene_path = scene_file.version_control()

        if scene_path:
            hou.hipFile.save(scene_path)
    else:
        print '>> Houdini file is not saved yet. Save scene first!'
Esempio n. 3
0
    def create_asset_scene(self):

        # Get Asset Object
        self.get_asset_data()

        # Create file path string
        asset_file_path = file_path.EveFilePath()
        file_type = entities.EveFile.file_types['asset_hip']
        asset_file_path.build_path_asset_hip(file_type, self.asset_data.asset_type, self.asset_data.asset.name, '001')
        scene_path = asset_file_path.version_control()

        # Save file
        if scene_path:
            if not os.path.exists(asset_file_path.location):
                os.makedirs(asset_file_path.location)
            hou.hipFile.save(scene_path)
Esempio n. 4
0
    def run_open_render_scene(self):
        """
        Open LAST existing scene version.

        WIP. Need to implement publishing and open user-defined or last published version.
        :return:
        """

        # Build string PATH to file
        file_type = entities.EveFile.file_types['shot_render']
        shot_file_path = file_path.EveFilePath()
        shot_file_path.build_path_shot_render(file_type,
                                              self.selected_sequence.name,
                                              self.selected_shot.name, '001')
        shot_file_path.build_last_file_version()

        hou.hipFile.load(shot_file_path.path)
Esempio n. 5
0
    def run_create_render_scene(self):

        # Build string PATH to file
        file_type = entities.EveFile.file_types['shot_render']
        shot_file_path = file_path.EveFilePath()
        shot_file_path.build_path_shot_render(file_type,
                                              self.selected_sequence.name,
                                              self.selected_shot.name, '001')

        scene_path = shot_file_path.version_control()
        if not scene_path:
            return

        # Create new scene
        hou.hipFile.clear()

        # Save file
        if scene_path:
            hou.hipFile.save(scene_path)
Esempio n. 6
0
import hou

from core import database
from core import file_path
from core import settings

# Get data
eve_root = os.environ['EVE_ROOT']
asset_id = int(sys.argv[-1])
eve_data = database.EveData(settings.SQL_FILE_PATH.format(eve_root))
asset = eve_data.get_asset(asset_id)

# Create EveFilePath
file_type = database.EveFile.file_types['asset_hip']
file_path_asset = file_path.EveFilePath()

# Get asset_type dictionary
asset_type_dic = None
for asset_type in database.Asset.asset_types:
    if database.Asset.asset_types[asset_type]['id'] == asset.type:
        asset_type_dic = database.Asset.asset_types[asset_type]

# Create file path string
file_path_asset.build_path_asset_hip(file_type, asset_type_dic, asset.name,
                                     '001')
scene_path = file_path_asset.version_control()

# Save file
if scene_path:
    hou.hipFile.save(scene_path)