Jump to content

Update Digital Asset


csp

Recommended Posts

Hi,

 

is there any way using python to tell which is the latest version of an digital asset?

 

lets say you have mytool::1.0 as your current version and there are two new versions mytool::2.0 and mytool::3.0 inside the same otl.

How can you get the latest available version, in order to avoid writing manually node.changeNodeType('mytool::0.3',True,True,True,False) ?

 

Christos

Link to comment
Share on other sites

If the parameter interfaces to your versioned HDAs are compatible, then it can be easier to use versioned namespaces and instead use the regular HDA version, then you can use the upgrade event script to fix problems introduced when upgrading from the older to the newer version. Versioned namespaces were designed to have multiple versions co-exist at the same time because their parameter interfaces may be drastically different and have non-backwards compatible behaviour.

Link to comment
Share on other sites

Ok, I am totally lost. I usualy have and otl let's say, "pipeline.otl" which contains couple of HDAs with different version for example: pro::cache::1.0, pro::cache::2.0, pro::mycam::1.0, pro::mycam::2.0, pro::mycam::3.0. Where pro is the namespace and usually either the name of the project or the initial of the user who builder the tool, the is followed by the name of the tool and at the end is the version.

Using this method I have multiple HDAs with multiple versions under the same otl. When I am adding a new version to an HDA will not update the existing instances of the DA inside the hip which are using older versions and that's good. But when I will drop a new instance will use the latest version, also good. But I would like to be able to have the option update existing instancies to the latest version. If the parameters match will keep the values if they don't will use the default.

Is that possible? Will the DA work correctly or a new instance should be used for tool to function properly with the latest version? What is the upgrade event script?

Sorry for all these questions but I would like for once and for all what's the proper way to create, save and update HDAs.

Edited by cparliaros
Link to comment
Share on other sites

Well, then the workflow you just described is changeNodeType(). If you don't want to automatically upgrade versions, you need a mechanism to do it explicitly, so it might as well be changeNodeType().

 

Whether an HDA will continue to work when you do that depends on the differents between the HDAs. I can't tell you whether the process will work or not because for all I know, the new version is completely different and there's no way to map from the old parameters to the new parameters. If you made minor changes inside, didn't change the parameter interface, then maybe.

 

By "upgrade event script", I meant the "Sync Node Version" event script; see http://www.sidefx.com/docs/houdini13.0/ref/windows/optype#events (and described in the "Version field" section in the link I posted above).

Link to comment
Share on other sites

so, we are coming back to my initial question, for an HDA instance which uses older version, like pro::cache::1.0 how can updated to the latest version without having to type having to type which version is the latest node.changeNodeType('pro::cache::2.0',True,True,True,False) ? 

 

Is there any way to get the latest version available for this tool [pro::cache::2.0] ?

Or at least all the available versions [pro::cache::1.0pro::cache::2.0]?

Link to comment
Share on other sites

why not use 1 .otl per HDA, per version with naming convention pro_cache_v1.0.otl
and use name spacing in HDA for interface changes, that way you'l get auto updates on compatible changes

Edited by Owl
Link to comment
Share on other sites

I like the idea on using otls as libraries of similar HDAs, for example my_fx.otl, my_utilities.otl, my_pipeline.otl etc. .

Then inside each otl having multiple HDA in multiple versions for each to HDA. 

I guess I can live without having an efficient way to update any selected node to its latests available version.

On the other hand, having an otl per HDA and per version would be easier to manipulate with python, but I would end up with a lot of files. 

Link to comment
Share on other sites

I found something better than 'otl' hscript which is helpful but not the most efficient solution. 

Playing with all available functions in hou I found node.type().namespaceOrder() and this is exactly what I needed! 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...