csp Posted September 17, 2014 Share Posted September 17, 2014 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 Quote Link to comment Share on other sites More sharing options...
edward Posted September 18, 2014 Share Posted September 18, 2014 According to the docs, I thought it's always going to use the latest available version by default when you create nodes? If you don't want the latest version, then you can use createNode() with exact_type_name=True. Quote Link to comment Share on other sites More sharing options...
csp Posted September 18, 2014 Author Share Posted September 18, 2014 Thanks for the reply Edward but I am talking about updated nodes already created using older version. Quote Link to comment Share on other sites More sharing options...
edward Posted September 18, 2014 Share Posted September 18, 2014 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. Quote Link to comment Share on other sites More sharing options...
csp Posted September 18, 2014 Author Share Posted September 18, 2014 (edited) 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 September 18, 2014 by cparliaros Quote Link to comment Share on other sites More sharing options...
edward Posted September 19, 2014 Share Posted September 19, 2014 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). Quote Link to comment Share on other sites More sharing options...
csp Posted September 19, 2014 Author Share Posted September 19, 2014 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.0, pro::cache::2.0]? Quote Link to comment Share on other sites More sharing options...
edward Posted September 19, 2014 Share Posted September 19, 2014 otls? Quote Link to comment Share on other sites More sharing options...
csp Posted September 19, 2014 Author Share Posted September 19, 2014 otls? Sorry what? Quote Link to comment Share on other sites More sharing options...
Owl Posted September 20, 2014 Share Posted September 20, 2014 (edited) why not use 1 .otl per HDA, per version with naming convention pro_cache_v1.0.otland use name spacing in HDA for interface changes, that way you'l get auto updates on compatible changes Edited September 20, 2014 by Owl Quote Link to comment Share on other sites More sharing options...
csp Posted September 20, 2014 Author Share Posted September 20, 2014 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. Quote Link to comment Share on other sites More sharing options...
Owl Posted September 20, 2014 Share Posted September 20, 2014 which you could store in a separate folders like otls/sop/utilities/*.otl Quote Link to comment Share on other sites More sharing options...
edward Posted September 21, 2014 Share Posted September 21, 2014 Sorry what? Sorry, this is what happens when I try to speed read/answer forums. http://www.sidefx.com/docs/houdini13.0/commands/otls Quote Link to comment Share on other sites More sharing options...
csp Posted September 21, 2014 Author Share Posted September 21, 2014 Sorry, this is what happens when I try to speed read/answer forums. http://www.sidefx.com/docs/houdini13.0/commands/otls Thanks edward, that will work. Quote Link to comment Share on other sites More sharing options...
csp Posted September 21, 2014 Author Share Posted September 21, 2014 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! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.