Layout node using absolute paths, migrating Asset database

   Views 393   Replies 3   Subscribers 1
User Avatar
Member
2 posts
Joined: Aug. 2019
Online
Hi!
I want to migrate a project made in Solaris, including an Asset database and Layout nodes. It looks like both Asset database and Layout node use absolute paths.
The same goes for Stage Manager, where you can't change the Asset Path under Reference detail.
Is there any way to change this, or am I missing something?
The project is locked in the original directory this way.

Any documentation on how the Asset database references files would also be appreciated.

Thanks

Thanks

Attachments:
usdReferenceIssue.jpg (448.5 KB)

Blender user slowly transitioning to Houdini.
User Avatar
Member
24 posts
Joined: Dec. 2016
Offline
once you use have picked something from the asset database, and placed it into a stagemanger or a layout lop, there is nolonger a connection , back to the database.

the asset database you may need to rebuild, its problaly the fastest with out learning python/sqllite to update the paths inside of the db. in tops there is a node called "USD add assets to gallery", that you can point to the new usd path locations and create a new db.

the layout lop next, inside the dive network for the layout lop, there will be a bunch of asset refernce lop's these will contain the paths to the assets used by the layout lop, you should be able to repath the assets here.

the stagemanager , is a little bit more tricky, depending on the amount of edits made , will depend on how many things you need to change.

pythonically, you could do something like this to find all the usd file paths and then replace them with the new location for those assets.

# get stagemanager node
smn = hou.node('/stage/path/to/stagemanager/node')
# get number of edits
num_edits = smn.parm('num_changes').eval()

# itterate over the edits to find which ones have usd paths
for i in range(1,num_edits + 1):
    
    usd_ref_path = smn.parm(f'reffilepath{i}').eval()
    
    print(f"usd_ref_path:: {usd_ref_path}")
    # look for a key word or partial file path 
    if 'project1' in usd_ref_path:
        # replace the filepath with a search and replace
        updated_usd_path = usd_ref_path.replace('project1','project2')
        # update the path:
        smn.parm(f'reffilepath{i}').set(updated_usd_path)

hope this helps.
User Avatar
Member
196 posts
Joined: Feb. 2017
Offline
Yes,this is a very obvious problem, I hope Houdini can solve it.
User Avatar
Member
2 posts
Joined: Aug. 2019
Online
Thanks everyone!
I will work with this in mind and hope it gets resolved in a more official way.

Thank you!
Blender user slowly transitioning to Houdini.
  • Quick Links