Show/Hide Toolbars

Clarisse 4.0 User Guide

Function

Description

FP fcurve(FP time, STRING path = “”)

Evaluate the f-curve bound the the attribute value given as path for the given time. Note that an empty path will evaluate the f-curve of the attribute for which the expression is being executed.

STRING find_item(STRING rule,STRING class)

Return the absolute path of the 1st item corresponding the the given rule and the given class. Rules follow the same syntax as in Groups.

Ex: find_item(“project://scene/*”, “Light”)

STRING get_context(STRING path)

When path is empty, return the path of the context of the current object in which the expression is being executed.

When path is not empty, split the path according to ‘/’ in N tokens and return the first N-1 tokens corresponding to the context path containing the item.

Ex: path = “A/B/C/D”, get_context returns “A/B/C”

Note: path = get_context(path) + “/” + get_name(path)

FP get_double(STRING path)

Return the floating-point value of the attribute value given as path.

Ex: get_double(“project://scene/light.translate[0]”)

FP get_name(STRING path = “”)

When path is empty, return the name of the current object in which the expression is being executed.

When path is not empty, split the path according to ‘/’ and return the last token corresponding to the name of the item.

Ex: path = “A/B/C/D”, get_name returns “D

Note: path = get_context(path) + “/” + get_name(path)

FP get_obj_var(STRING var)

 

FP get_obj_var(STRING var, FP index)

 

FP get_obj_var(STRING path, STRING var)

 

FP get_obj_var(STRING path, STRING var, FP index)

Returns the value of a Clarisse object's variable. For instance, if you're loading an Alembic file where objects have a “foo” property with 10 values, if you want to retrieve the first value, here are the 4 variants of this function:

  1. get_obj_var("foo")[0]
  2. get_obj_var("foo", 0)
  3. get_obj_var("project://bar", "foo")[0]
  4. get_obj_var("project://bar", "foo", 0)

Variants 1 and 2 will retrieve the variable from the object the expression is bound to, while 3 and 4 retrieve the variable from another object by its address.

Note: Variants 1 and 3 return an array of the value, while 2 and 4 return a single value.

Note: Returning a single value is a lot more efficient and should be privileged.

 

STRING get_string(STRING path)

Return the string value of the attribute value given as path.

Ex: get_string(“project://scene/light.parent”)

VECTOR get_vec3(STRING path)

Return the vector value of the vector attribute given as path.

Ex: get_vec3(“project://scene/light.translate”)

STRING join_path(STRING path1, … , STRING path N)

Concatenate all path* and insert a platform specific file path separator between each path*.

  • Ex on Linux: join_path(“A”, “B”) returns “A/B”

Ex on Windows: join_path(“A”, “B”) returns “A\B”

STRING to_string(FP x)

Return a string representing the given number.

Ex: to_string(3.14) returns “3.14”.

Isotropix

Copyright (C) 2009-2019 Isotropix. All rights reserved.