[Bf-python] Render

Gilbert, Joseph jgilbert at tigr.org
Mon Mar 8 15:49:18 CET 2004


Hi,
	Originally I was thinking the same thing. Because Each scene has it's own rendering data. I think that's what I'll go back and do. There are A LOT of things that are required by this module, and rather than simply clutter the scene module with them I would rather see them in a separate source file. There are a couple of options on how to do this. The first would be to make Render a submodule of Scene. So you could call Blender.Scene.Render.Function(). (I was doing this originally) The other is simply to add prototypes of render funcitons to the methoddef of the scene module and when getattr is called it simply returns data from the render source files. I think something like this would be the best. This way you would call Render.Scene.Function() but it would call prototypes in the render module. The third way would be to create a render python type and fill it with data and then set the data. The reason I don't like this is because there is no need to ever create a render data type - it's simply a part of the scene. 

Im almost done with the whole thing. The only thing left is yafray settings, and some bugs with SGI and Quicktime output (**ty #ifdef's).

There are some things in the render module that refer to the render window that don't apply to a scene. Such as opening/closing the render window and setting it's size and position. These variables are global and set in the 'R.r' RE_render struct, not in the 'G.scene->r' RenderData struct. It's o.k. because some of the prototypes could be called from the scene module (Blender.Scene.Function()) and others maybe that don't refer to a specific scene could be called as a submodule or as a global module. Blender.Render.Function() or Blender.Scene.Render.Function()) That way it's recognized they are global and don't pertain to the scene your working on only. 

p.s. Im sorry gregor I didn't see your patch. I also haven't heard from dunk. Anyway I should finish this in a few days and I'll post it to see if anyone would like to change it in anyway. Just let me know. :) 

-----Original Message-----
From: bf-python-admin at blender.org [mailto:bf-python-admin at blender.org] On Behalf Of Carlos López
Sent: Monday, March 08, 2004 2:53 AM
To: bf-python at blender.org
Subject: Re: [Bf-python] Render

Hi. I speak from my unknowledge :), so this's my idea: as you say, many of the render features are in "scene" source blocks. Indeed, a single scene must be set when a "render()" method is called. So, why is necesary a new whole module? Is not enough a simple calling like, for example:

sc=Scene.Get(...)
sc.Render(parameters)

Moreover, a image will returned, so a code would be like: 

sc.Render( BlenderImageObject , parameters )

I wonder. ???

Klópes

>Subject: [Bf-python] Render
>   From: "Joseph Gilbert" <models at paposo.com>
>   Date: Sat, 6 Mar 2004 11:10:49 -0500
>     To: "Bf-Python at Blender. Org" <bf-python at blender.org>
>
>Just a note. The render module is pretty easy to build, however, I just
>realized that a lot of items that are associated with rendering are
>currently in the scene module. Things like getting/setting the aspect ratio
>for the render for instance. Anyway, this isn't a big deal. For the things
>that are part of the scene module that related to rendering, Scene will call
>the functions from the render module and return. That way there is no API
>breaking.
>
>I was playing with the idea of making render a submodule of scene because
>the scene struct contains a renderdata struct but most all of the render
>options are applied globally. Also there are some items that apply to the
>RE_render struct only (relating to the render window) which is not part of
>the scene struct. So Im going with the idea of not making render a submodule
>to scene and simply calling render functions from the scene module where
>appropriate. This means the prototypes for render are non static.
>
>Joseph
>
>_______________________________________________
>Bf-python mailing list
>Bf-python at blender.org
>http://www.blender.org/mailman/listinfo/bf-python
_______________________________________________
Bf-python mailing list
Bf-python at blender.org
http://www.blender.org/mailman/listinfo/bf-python



More information about the Bf-python mailing list