Switching off scene ambient occlusion
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 16/11/2011 at 03:32, xxxxxxxx wrote:
Hey folks.
Is it possible so switch the scene ambient occlusion off via python?
I've tried with this script but it doesn't do anything:import c4d from c4d import gui,documents def main() : rdata = doc.GetActiveRenderData() rdata[c4d.VPAMBIENTOCCLUSION_APPLYTOSCENE] = 0 c4d.EventAdd() if __name__=='__main__': main()
Instead of applying the value of 0 I also tried False, again, nothing.
Any tips or knowledge you can share with me?
Thanx
Phil -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 16/11/2011 at 04:00, xxxxxxxx wrote:
Hi,
Ambient Occlusion is a Video Post effect so you can't directly access it like standard render data.
Here is how to disable scene ambient occlusion:import c4d def main() : # Get render data rdata = doc.GetActiveRenderData() if rdata == None: return # Get first Video Post effect post = rdata.GetFirstVideoPost() if post == None: return # Loop through Video Post effects while post: if post.GetType() == c4d.VPambientocclusion: post[c4d.VPAMBIENTOCCLUSION_APPLYTOSCENE] = False # Disable Ambient Occlusion post = None # Stop loop else: post = post.GetNext() c4d.EventAdd() if __name__=='__main__': main()
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 16/11/2011 at 04:05, xxxxxxxx wrote:
This is because the data is not saved in the render data itself, but in one of the objects in its VideoPost list.
import c4d from c4d import gui,documents def main() : rdata = doc.GetActiveRenderData() post = rdata.GetFirstVideoPost() post[c4d.VPAMBIENTOCCLUSION_APPLYTOSCENE] = False c4d.EventAdd() if __name__=='__main__': main()
The only problem I don't know how to solve is, how to determine wether the post is the post you search for. Of course you could compare their names, but what if the user has renamed it ?
Cheers,
// Edit: Ahh using GetType. Thanks Yannick. But such things should definitely be documented.
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 16/11/2011 at 04:29, xxxxxxxx wrote:
Originally posted by xxxxxxxx
// Edit: Ahh using GetType. Thanks Yannick. But such things should definitely be documented.
GetType() is documented but working with objects we have to look at C4DAtom, GeListNode, BaseList2D etc.
And to find VPambientocclusion I had to print the Video Post type and search it in all the header files.
All these enums should be documented to avoid searching in files. -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 16/11/2011 at 04:56, xxxxxxxx wrote:
Yes, GetType is documented. But I hadn't expect it do differ on VideoPost data, too.
Originally posted by xxxxxxxx
I had to print the Video Post type and search it in all the header files.
Maybe you wanna try this one next time.
import c4d def main() : rdata = doc.GetActiveRenderData() post = rdata.GetFirstVideoPost() t = post.GetType() for k, v in c4d.__dict__.iteritems() : if v == t: print "Maybe you are searching for `" + k + "` ?" main()
Maybe you are searching for `VPambientocclusion` ?
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 16/11/2011 at 06:34, xxxxxxxx wrote:
Thank you very much, it works. This will become a real time saver
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 16/11/2011 at 07:33, xxxxxxxx wrote:
Originally posted by xxxxxxxx
All these enums should be documented to avoid searching in files.
Welcome to my world.
It's refreshing to hear someone in a moderator role say the same thing.-ScottA
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 08/03/2012 at 07:40, xxxxxxxx wrote:
Hi there,
I also try to disable AO. So I read the topic and messed around for some hours to get it work. but the following script That I copied from this thread is not working under 13.051.
If it is a simple mistake ... sorry for that I am a newbee. But I have no Idea what to do next:(Thanks, Jops
import c4d
def main() :
# Get render data
rdata = doc.GetActiveRenderData()
if rdata == None: return
# Get first Video Post effect
post = rdata.GetFirstVideoPost()
if post == None: return
# Loop through Video Post effects
while post:
if post.GetType() == c4d.VPambientocclusion:
print "DETECTED"
post[c4d.VPAMBIENTOCCLUSION_APPLYTOSCENE] = True
#post.SetBit(c4d.BIT_ACTIVE) # also not working
c4d.EventAdd()
post = None
else:
print "else"
post = post.GetNext()
c4d.EventAdd()if __name__=='__main__':
main() -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 08/03/2012 at 08:39, xxxxxxxx wrote:
Hello Jops,
post[c4d.VPAMBIENTOCCLUSION_APPLYTOSCENE] = True
This line will turn this checkmark on!
If you want to disable it, change the value to False.
post[c4d.VPAMBIENTOCCLUSION_APPLYTOSCENE] = False
Cheers,
Niklas -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 08/03/2012 at 09:04, xxxxxxxx wrote:
Hello Niklas,
ahh wenn wron bool then
I would love to be able to read-out and activate this bool here:
any chances?
thanks a lot
Jops -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 08/03/2012 at 11:45, xxxxxxxx wrote:
Hi Jops,
I digged a bit through the SDK and found out that you can use post.SetBit(c4d.BIT_VPDISABLED) and post.DelBit(c4d.BIT_VPDISABLED) to either disable or enable the video-post. Note that, as the constant is called VP_DISABLED, setting the bit will disable the video-post, deleting the bit will enable it. Confusing, if you ask me
Also note, that your call to c4d.EventAdd() before post = None is redundant, as you call it at the and of main() anyway..
# Disables the Ambient Occlusion Video-post from the Render Manager import c4d def main() : rdata = doc.GetActiveRenderData() if not rdata: return pdata = rdata.GetFirstVideoPost() if not pdata: return while pdata: if pdata.CheckType(c4d.VPambientocclusion) : pdata.DelBit(c4d.BIT_VPDISABLED) pdata = None else: pdata = pdata.GetNext() c4d.EventAdd() main()
Cheers,
-Niklas -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 09/03/2012 at 01:39, xxxxxxxx wrote:
Hi Niklas,
Thanks a lot for you great advice. I will imideately test it out.
did you find it in the Python SDK (that would mean that I did not look hard enough :()
best wishes
Jops -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 09/03/2012 at 03:21, xxxxxxxx wrote:
Hi Jops,
I knew about the use of BaseList2D.SetBit() and ~.GetBit() before. After searching some minutes they appeared in my mind. Looking at their documentation made me spot the VP_DISABLED constant, and it all made sense.
I think, understanding the documentation and knowing what to search for requires a lot of experience, you don't have to shame.
Cheers,
-Niklas -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 09/03/2012 at 03:39, xxxxxxxx wrote:
Thank you...
I try hard and for quite a while to get into it, but it takes a lot of time especially if you have no friend or college who already knows his stuff
CU
Jops -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 09/03/2012 at 06:11, xxxxxxxx wrote:
Just to let you know, if you're in a hurry getting into the Py4D SDK: I'm currently giving private education especially belonging to the Py4D SDK to someone from Utah, America.
Cheers,
-Niklas -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 09/03/2012 at 06:27, xxxxxxxx wrote:
niklas du hast eine PM.