Page 1 of 1

Set camera by find_object()

Unread postPosted: Wed Jun 12, 2019 3:22 pm
by buzz3d
Hi everyone,

I am trying set "Active Camera" and "Renderer" on the layer by expression.

my project and print: https://drive.google.com/drive/folders/ ... sp=sharing

Active Camera : find_object("./scene/abc/*", "perspective")
Renderer: find_object("./setup/render/*", "path_tracer")

Can anybody help me ?

Thanks!

Re: Set camera by find_object()

Unread postPosted: Wed Jun 12, 2019 4:43 pm
by dcourtois
Hi,

find_object is not a valid function. We have find_item which I think is what you want to use. You can check the logs in Clarisse to check SeExpr compilation errors. If you try using find_object, the error is "Function find_object has no definition".

You can check our documentation. It lists all the functions available. The one you want (find_item) is documented here: https://clarissewiki.com/4.0/constant-and-functions-referen.html. And in its doc, it's stated that the first parameter follow the rules for Groups, which is also documented here: https://clarissewiki.com/4.0/rule_based_inclusion_exclusion.html and that the second parameter is a class name. And "path_tracer" is not a class name. Class names in Clarisse always use "ThisTypeOfNotation". You want "CameraPerspective" and "RendererRaytracer" (it's in the "Type" column of the Browser view)

Hope this helps.

Regards,
Damien.

Re: Set camera by find_object()

Unread postPosted: Wed Jun 12, 2019 6:33 pm
by buzz3d
Hi Damien,

Thanks for help. I put "find_item('project://<context>/<context>/*', 'RendererRaytracer')" and it worked.

:D :D :D :D