I’m struggling to create new UDA with python script. I’m using autodesk_toxik.admin.setUDA method but always says that there’s no such a component. I’ve tried to set the component path parameter to “Project:Title”, “User:Administrator”, simply “Composition”, but none of them worked.
Could someone explain the concept of components in UDA’s point of view, or could someone give me an example of component path, please.
Ok, here is what I think may be going on, bit of a long shot. Just as a side note, and I may not know what exactly you are doing, but you are wanting to set the UDA value of a existing UDA, is that correct? If you want to create a new one which you seem to have indicated you would want, which you can do this way, but is not as flexiable in my eyes as using the Class udaMGR and the method create(...). This is just a suggestion. Anyway, back to my hunch.
If you have any, (I am assuming you are under win7?) permission issues with how you have setup Composite, it will be hard to create new UDA within the system. I am not sure if this extends to Python, but I would think it would considering it is a OS issue. You need to check this out. One quick way is to see if you can just create a UDA within Composite itself, if you are having issues doing this, then you have this problem of permissions.
I have done a video on my blog on this issue, you can fine it here: http://enigmafx.wordpress.com/2010/10/21/videotip8-permission-issue-and-my-fix/
If it is not this, I would have to look at this further.
I tried to make new UDA manually, and this Composite hang, so I’ve gave up with it (now, after I’ve fixed permission it works ok).
I’ve started to implement new UDA with python. I want create two new UDAs - one containing date value, but in different format YYYY-MM-DD, instead of YY-MM-DD. I just don’t know if it is possible to change date format in composite.
And another UDA should containing image import node’s file sequence path. This is the main reason why I’ve started to to deal with python. I want to use import path in output node, to save output to the input path. In Nuke it is possible to enter expression into ouput path field to pick out import node’s input path - something like
. I want to implement something similar in composite.
Concerning autodesk_toxik.admin.setUDA command - is not it a shortcut to udaMGR methods? udaMGR.setValue() method also requires path argument. My main concern by the moment is the path argument - what is this, where should I get it from?
I am not sure if you can change the date format either…
In regards to the import path, you can do this. You just get the string for the image import and then substitute the string on the output with the string from the imput and you should be good to go. Just remember you can also use tokens within the filePathPattern.
As far as the import path variable, I am not 100% up on this myself, but one thing you need to remember is that in Composite you are working in a pre-defined project and project path for example: x:/mark/project1 and within this you would have a structure that is designed to be accessed by you quickly and easily since it is all pre-defined, within the project. So a admin.getactualfilepath would be an example of this. I am not up on this as other are so perhaps someone else will chime in. I just do not have the time at the moment to work this out for you. I will say that you can do this. It is not just a mater of change or accessing the file path like in NUKE, it works on a different methodology. You are looking for a path of a composition, or a path of the project. I hope this makes sense.
VFX - Supervisor | Compositor
Could you please give me an example of using autodesk_toxik.admin.setUDA() or udaMGR.setValue() ? I just can’t get it work. First argument in both commands is some PATH and I can’t find the meaningful value for that.
I am sorry I am not able to offer more help, this is an interesting issue and I would love to dive into it at this time, but I can’t, I will do my best to offer tips that will direct you. Once I get some open time I will look into it. I have noted it. Remember I do not work for ADSK, so my time is limited. ;-)
Now you have used:
udaMgr.setValue(admin.ProjectMgr.getCurrent().getPath(), ‘new_uda’, ‘new_value’) as a way to set the value to the defined UDA with the project path.
As noted in the document, the only exception is if the UDA that is being assigned is not actually in the project. Just a thought, incase it is not creating it? Also, you have put the captured path value and put it as the first Parameter, and as documented this ‘path’ is not the path that you have captured. This would be assigned to ‘value’ parameter. The ‘path’ parameter, well I am not sure what it is referring to, I have not looked into this. UDA’s are global, so why the specific path.. hmmm Had a little look at the XML tags for the UDA’s and nothing relating to path. I wish I could help on this, just not sure what that parameter is referring to.... Try it with the ‘path’ parameter and see what happens?