Page 1 of 1

Area Light Camera Visibility Does Not Work Via Python

Posted: Mon Jul 01, 2024 2:46 pm
by Seggy
Hi,

If you change an Octane mesh lights' visibility via python, it does not work.

Tested under the custom Octane Blender build: v2023.1.3.28.15
Python command:

Code: Select all

bpy.data.objects["My Light"].octane.camera_visibility = False
I'd expect that to turn the light off and on when toggled like it does when you click on the checkbox in the GUI.
Note that via python you will not see the GUI change until you click off and back on to the object properties tab.

Cheers,
Simon.

Re: Area Light Camera Visibility Does Not Work Via Python

Posted: Fri Jul 12, 2024 7:44 am
by linograndiotoy
It looks like a general issue with Python commands updates. We'll look into that. Thanks!

Re: Area Light Camera Visibility Does Not Work Via Python

Posted: Fri Jul 12, 2024 9:51 am
by linograndiotoy
Regarding the viewport update issue, it stems from a limitation in Blender. Specifically, Blender does not automatically trigger an update for add-on attributes when they are modified through a script. To address this, you need to manually call an update function.

In your case, you can use bpy.context.object.update_tag() to trigger the necessary update and resolve the issue. If you are writing scripts, you can include this function at the end of your update function to ensure the viewport updates correctly.

Re: Area Light Camera Visibility Does Not Work Via Python

Posted: Fri Jul 12, 2024 11:45 am
by Andreas_Resch
Yeah. I can confirm that. Had the same issue when writing my addon.