I use the 4th layer in blender for my lighting and camera(s). I shift+4 before I press f12 to render … and I forget a lot. Even if I don’t forget, it becomes tedious since I have about 3-4 other layers I do this with too.
What I want is for blender to check whether or not X layers are enabled when a hotkey is pressed (f12 in this case), and if not, to toggle them on before rendering.
Does something like this exist? I couldn’t find anything via google. And if not, is something like this difficult to create?
Thank you for the link … though do you have other links you could share that would send me down the right path? Specifically for how to check if layers are enabled. Because sometimes I have the layers already enabled when I render, and I wouldn’t want it to disable them instead. All I could find was this.
I have zero knowledge of python, though I have created one basic addon in the past (making a hotkey for changing the IK solver) by googling random things and trial and error… lmao. So I’m willing to try here, I’m not asking for anyone to do the work for me. I just don’t know the keywords to search to find what I need.
You can see if the fourth layer is visible with:
bpy.context.scene.layers[3]
It will be True if visible and False if not visible in the scene. (try print(bpy.context.scene.layers[3]) in the python console)
To set the layer to be visible you can simply do bpy.context.scene.layers[3] = True.
And I’m also wondering… is there a way to specify the layers rather than editing the script each time I want to change them? I’ve seen how to do the toolbar part from this tutorial but I have no idea how to translate that to my script.
I want to do this (below), so you can select them but not change the active layers in the viewport … (this is photoshopped)