RenderData

Scripting in Blender with Python, and working on the API

Moderators: jesterKing, stiv

Post Reply
kennah
Posts: 0
Joined: Sat Jun 05, 2004 7:56 am

RenderData

Post by kennah »

Hi

I cant seem to use the RenderData class from the API. I'm new to python and blender. What I am trying to do is capture the camera rotation and output this info to a file.

Can anyone point me in the right direction?

TK

matt_e
Posts: 410
Joined: Mon Oct 14, 2002 4:32 am
Location: Sydney, Australia
Contact:

Post by matt_e »

Moved this to the Python forum

ascotan
Posts: 0
Joined: Thu May 29, 2003 10:32 pm
Location: Maryland, U.S.

Post by ascotan »

Here's the deal:
Each scene has it's own data set it uses to render it. This data is wrapped in a RenderData structure (which is a python object). To get this rendering data context for a scene call

Code: Select all

renderData = scene.getRenderingContext()

kennah
Posts: 0
Joined: Sat Jun 05, 2004 7:56 am

Post by kennah »

Code: Select all

renderData = scene.getRenderingContext()
Thanks for moving this post and for the answer.

I've been using other languages but python seems cool enough. I'm going to search for a document I need to learn how to import what I need from Blender. I'm trying this for now:

Code: Select all

import Blender
and get the current scene, I read this somewhere:

Code: Select all

scene = Blender.getCurrentScene()
Thats not working so I need figure this one correctly. Well thanks for the answer and if anyone wants to point me to the relevant documentation it would be appreciated.

Hopefully my hunt will succeed.

TK 8)

ascotan
Posts: 0
Joined: Thu May 29, 2003 10:32 pm
Location: Maryland, U.S.

Post by ascotan »

it should be Blender.Scene.getCurrentScene()

http://www.paposo.com/pythonAPI233a/ = API documentation
http://www.elysiun.com/ = python scripting help

kennah
Posts: 0
Joined: Sat Jun 05, 2004 7:56 am

Post by kennah »

ascotan wrote:it should be Blender.Scene.getCurrentScene()
Thanks again. I am a little confused because for me it seems that the follwoing works:

Code: Select all

Blender.Scene.getCurrent()
Whereas:

Code: Select all

Blender.Scene.getCurrentScene()
Gives:

Code: Select all

AttributeError: 'module' object has no attribute 'getCurrentScene'
Have things been changing recently? Is this a version of the API thing?

Oh well thanks again for all the help.

TK

Sutabi
Posts: 53
Joined: Fri Oct 18, 2002 1:35 am
Location: Oceanside, California
Contact:

Post by Sutabi »

Okay this is getting me mad... tring to update a script for the newer blender but I cant get access to Render Module!!!

Code: Select all

import Blender
from Blender import Scene
from Blender import Scene.Render
 
scn = Scene.GetCurrent()
context = scn.getRenderingContext()

print dir(context)
Error:
SyntaxError: invalid syntax
File "Text", line 3
from Blender import Scene.Render


Why I need to access it?
RuntimeError: Depricated:use RenderData.imageSizeX() and RenderData.imageSizeY

Also there may be a typo in the example with the two .. with Render..enableDispWin() but I wouldn'r know cause I cant run it

Sutabi
Posts: 53
Joined: Fri Oct 18, 2002 1:35 am
Location: Oceanside, California
Contact:

Post by Sutabi »

It should read:

Code: Select all

from Blender.Scene import Render

Post Reply