- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi, I'm trying to figure out how to use "cancelled" function of the render() function in python. I'm referencing these docs, trying to convert the function to python, but having issues getting it to work.
Here is the simplified code that i'm having issue with:
from pymxs import runtime as rt
render_canceled = False
r = rt.render(
camera=camera,
frame=frame,
outputwidth=resolution,
pixelaspect=pixel_aspect,
outputfile=outputfile,
vfb=False,
progressbar=False,
cancelled = render_canceled, # Cant figure out how to use in python
to=rt.Bitmap(1, 1)
)
I have everything working except for the "cancelled" parameter. If i comment that out, everything works fine, but i'd like to get that working. If I uncomment it, i get the error below when run.
r = rt.render(
^^^^^^^^^^
RuntimeError: MAXScript exception raised.
-- Unable to convert: false to type: &-reference
I don't know enough about python or Maxscript to know what it means, but my guess is that it has to do with a conflict between how python and maxscript work internally. It seems Maxscript needs a variable reference to write a True/False value to, but python is providing a value (False) instead of the variable reference. I don't know how in python (or if it's even possible) to provide the variable reference instead.
Does anyone know how to get this working? Thanks!
Solved! Go to Solution.
