Isotropix Forums

quick question about variables and variable editor

Clarisse Scripting related topics

quick question about variables and variable editor

Unread postby anabil » Thu Mar 23, 2017 7:46 am

hi,

i was doing a quick research for using variables to easily change shot numbers in alembic camera and alembic geometry as well but unfortunately that partially didn't work, for example,

what i have in my scene is :
Camera in : C:/PROJECT/SHOTNUMBER/PROJECT_SHOTNUMBER_camera.abc
Geos in : C:/PROJECT/SHOTNUMBER/PROJECT_SHOTNUMBER_geo.abc

i wrote a variable like this : $SHOT = sh00.
i imported alembic camera and alembic geo to my scene and then i changed "SHOTNUMBER" to $SHOT in both my camera and geo alembic file path.

this worked for the first SHOTNUMBER in the path file but did not work in the camera name itself, and what i mean by that is for example,
$SHOT = sh00
C:/PROJECT/$SHOT/PROJECT_sh00_camera.abc this one works
C:/PROJECT/$SHOT/PROJECT_$SHOT_camera.abc this one doesn't work :(

so is there a limitation or something that this doesn't work for the camera name and only works for paths? or maybe i'm missing something here.

i hope i explained the situation right, and thanks in advance :)
anabil
 
Posts: 11
Joined: Tue Mar 21, 2017 11:51 am

Re: quick question about variables and variable editor

Unread postby bvaldes » Thu Mar 23, 2017 11:26 am

Hi,

When the variable is in the middle of a string you have to us a character to specify the end of the variable: ":". In your case the path should be written like this:

Code: Select all
C:/PROJECT/$SHOT/PROJECT_$SHOT:_camera.abc
result: C:/PROJECT/$SHOT/PROJECT_sh00_camera.abc

The reason why you need to add this character is that your variable is followed by an allowed character. Clarisse thinks that your variable is called: "$SHOT_camera" instead of "$SHOT".

For more information, you can refer to the documentation: http://www.clarissewiki.com/3.0/using_variables.html

Regards
Benoit VALDES
Isotropix
Clarisse QA
User avatar
bvaldes
 
Posts: 117
Joined: Mon Sep 26, 2016 11:44 am

Re: quick question about variables and variable editor

Unread postby anabil » Tue Mar 28, 2017 8:55 am

Hi bvaldes,

sorry for my late reply, i saw your answer the other day but i forgot to replay later but it worked perfectly.
i have a related question though, since my variable needs a separator like ":" when it's in the middle of a path, does it need exactly this separator ":" or it can be "," or "?" .. etc like in the documentation?

great software by the way guys, love it :)

thanks.
anabil
 
Posts: 11
Joined: Tue Mar 21, 2017 11:51 am

Re: quick question about variables and variable editor

Unread postby bvaldes » Tue Mar 28, 2017 9:22 am

Hi,

No, you need to use the character ":". This character is the only one which will be deleted after path resolution.
Example with $VAR = shot:
Code: Select all
$VAR01/my_file.jpg => $VAR01/my_file.jpg
$VAR:01/my_file.jpg => shot01/my_file.jpg
$VAR;01/my_file.jpg => shot;01/my_file.jpg


Hope this help, cheers.
Benoit VALDES
Isotropix
Clarisse QA
User avatar
bvaldes
 
Posts: 117
Joined: Mon Sep 26, 2016 11:44 am

Re: quick question about variables and variable editor

Unread postby anabil » Wed Mar 29, 2017 6:46 am

great i get it now.
cheers.
anabil
 
Posts: 11
Joined: Tue Mar 21, 2017 11:51 am


Return to Scripting