Jump to content

Custom attribute. Set value from shot name.


Alberto GZ

Recommended Posts

I create a custom attribute called "Photo kind" of type Expression and result Text. I want get three coded characters of Shot Name, and return a specific text value.

 

Example: Shot names contain words "AMB", "DET", or "VAR". Then if name contains "DET", text value will be "detail".

 

For this I use a conditional, but I don't see how to evaluate more of two conditions.

 

Here my current sentence for this, but in any Shot Name always show value "ambient" 

{func.IF(self.name <= 'AMB', 'ambient', func.IF(self.name<='DET', '', 'detail'))}
Link to comment
Share on other sites

The IF function syntax is:

func.IF(expression1, expression2, expression3)

which means expression3 is the 'else' statement.

 

I've modified my example slightly, please try the following instead:

{func.IF(func.locate('AMB', self.name), 'ambient', func.IF(func.locate('DET', self.name), 'detail', func.IF(func.locate('VAR', self.name), 'variable', 'none')))}
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...