laura.c Posted October 1, 2014 Report Share Posted October 1, 2014 Hi, I try to define a custom attribute on Project. It should be Expression type and return Text. It should be a substring of project Code, but when trying to access {self.name}, I get "Expression could not be parsed". Is this attribute (name) not available for projects? I would like to convert python expression "prj-"+"-".join(project.get("name").split("-")[1:]) into an expression for a custom attribute. Is it possible? Thanks.Laura Link to comment Share on other sites More sharing options...
Mattias Seebergs Posted October 2, 2014 Report Share Posted October 2, 2014 Hi Laura, The expression attribute type is not available on projects at present. I've added a ticket on making that more clear in that dialog. If you want to add an expression type attribute to another level, the corresponding expression would be:prj-{func.substring(Project.fullname, func.locate('-', Project.fullname)+1)}Mattias Link to comment Share on other sites More sharing options...
laura.c Posted October 10, 2014 Author Report Share Posted October 10, 2014 Thanks Mattias. If I want to use the result in my scripts. how do I get it? I tried:myShot.get(customAttributeName) but it returns the expression itself, not the result. Laura Link to comment Share on other sites More sharing options...
Mattias Seebergs Posted October 10, 2014 Report Share Posted October 10, 2014 That should return the result, and I just checked to be sure. I used the following:import ftrackshot = ftrack.Shot('<shot id>')print shot.get('<custom attribute name>')That prints my calculated value. Please check your code and let me know if you still have problems. Mattias Link to comment Share on other sites More sharing options...
laura.c Posted October 14, 2014 Author Report Share Posted October 14, 2014 Hi Mattias, it works, thanks a lot. What it's a bit annoying is, that, once a custom attribute is defined as an expression assigned to an object (for eg shot), the user can't change the object anymore (for eg. to asset version). It needs to be redefined. Is there a reason for this behavior? Also, it would be great to have more documentation for this topic. Cheers,Laura Link to comment Share on other sites More sharing options...
Mattias Seebergs Posted October 15, 2014 Report Share Posted October 15, 2014 There's no specific reason, it's just not implemented. Any particular section you'd like to be covered? Have you noticed the help available by clicking the question mark in the Create attribute dialog? Cheers Mattias Link to comment Share on other sites More sharing options...
laura.c Posted November 4, 2014 Author Report Share Posted November 4, 2014 Thanks Mattias! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.