Hi I trying to sue the -P command to call a script to override material of my scene.
there is something wrong with it :
I would like to force the render engine to switch in raytrace but Ican't get it to work.
this the code I am using actually :
import mantra
Verbose = True
mantra.setproperty('renderer:renderengine','raytrace')
print ‘Renderer’, mantra.property('renderer:renderengine')
def filterInstance():
print ‘Filtering:’, mantra.property('object:name')
mantra.setproperty('object:surface', ‘opshop/occ’)
mantra.setproperty('objectverridedetail', 1)
even if I use number instead of string nothing changes … but the print tells me it changed !
thanks for your advice
Vincent
what's wrong with this script ?
1647 2 1- vbk!!!
- Member
- 383 posts
- Joined:
- Offline
- tamte
- Member
- 8602 posts
- Joined: July 2007
- Online
you are setting the renderer outside of any filtering function so it will not be called in the right time for the actual mantra node that is being processed, but rather globally before everything
this should work
import mantra
def filterCamera():
mantra.setproperty('renderer:renderengine','raytrace')
this should work
import mantra
def filterCamera():
mantra.setproperty('renderer:renderengine','raytrace')
Tomas Slancik
FX Supervisor
Method Studios, NY
FX Supervisor
Method Studios, NY
- vbk!!!
- Member
- 383 posts
- Joined:
- Offline
-
- Quick Links