2004-03-14 02:06:57 +00:00
|
|
|
/*
|
2004-09-18 18:47:03 +00:00
|
|
|
* $Id$
|
2004-03-14 02:06:57 +00:00
|
|
|
*
|
|
|
|
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
|
|
|
|
*
|
|
|
|
* This program is free software; you can Redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version. The Blender
|
|
|
|
* Foundation also sells licenses for use in proprietary software under
|
|
|
|
* the Blender License. See http://www.blender.org/BL/ for information
|
|
|
|
* about this.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software Foundation,
|
|
|
|
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*
|
|
|
|
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* This is a new part of Blender.
|
|
|
|
*
|
|
|
|
* Contributor(s): Joseph Gilbert
|
|
|
|
*
|
|
|
|
* ***** END GPL/BL DUAL LICENSE BLOCK *****
|
|
|
|
*/
|
|
|
|
|
2004-04-25 05:18:43 +00:00
|
|
|
#include <BIF_renderwin.h>
|
|
|
|
#include <BKE_utildefines.h>
|
|
|
|
#include <BKE_global.h>
|
|
|
|
#include <DNA_image_types.h>
|
|
|
|
#include <BIF_drawscene.h>
|
|
|
|
#include <BLI_blenlib.h>
|
|
|
|
#include <BKE_image.h>
|
|
|
|
#include <BIF_space.h>
|
|
|
|
#include <DNA_scene_types.h>
|
|
|
|
#include <DNA_space_types.h>
|
|
|
|
#include <mydevice.h>
|
|
|
|
#include <butspace.h>
|
|
|
|
#include <BKE_bad_level_calls.h>
|
BPython:
- Scripts:
fixed error in "Save Current Theme" which prevented it from automatically updating script registration in menus.
cosmetic changes in a couple of Campbell's sel_same.py script strings + more descriptive name for its new menu place (3d view, face mode -> select menu).
small updates to help_browser.py script.
The above changes are related to this:
- Added new script menu entries: Render (for exporters to renderers), Themes, FaceSelect (this already at the proper place). Updated Scripts win->Scripts menu so it won't show all available entries, only the ones we mean to see there.
- Updated menu registration so that scripts folders can become trees. The release/scripts/ dir should be updated soon with subdirs like converters/, modifiers/, generators/ or whatever -- better discuss first (or is it? /me afraid of long irc discussions during meetings :) ).
- Modules:
Blender: added 'udatadir' option to .Get() function and added var Blender.mode to tell if Blender is in bg or interactive mode.
NMesh: added Campbell's nmesh.transform(matrix, recalc_normals = False) method (reworked, so my fault if it doesn't work).
- Bugs fixed:
#2123: http://projects.blender.org/tracker/?func=detail&atid=125&aid=2123&group_id=9
Reported by Ken Hughes (thanks!), who also found the exact problem later (it was in Text.Load, not with script links -- if only I had checked emails these days ... lost > 1 hour today to find the problem: passed filename to M_Text_Load was later being written over by a function called by add_text). Also saw that Text.Load wasn't checking existence of passed filename (duh!), now it does.
#1655: http://projects.blender.org/tracker/?func=detail&atid=125&aid=1655&group_id=9
Reported by Chris Want (thanks!): command line "blender -P script" not working properly for bg mode ("blender -b blendfile -P script").
Had to make some small updates to get it working (bg mode for scripts was never explicitely handled, it worked due to collateral effects, let's say), interested readers can check the report after I update it or the API_intro.py doc file. After more testing we can make further updates. Updated many places to not call redraws if in bg mode, now it is officially available. Blender outputs its own info when rendering in bg mode, if that is considered a nuissance we'll have to add a few "if (during_script())" calls outside bpython.
- Removed a few warnings here and there and also updated docs.
2005-03-19 06:24:55 +00:00
|
|
|
#include <render.h> /* RE_animrender() */
|
2004-03-14 02:06:57 +00:00
|
|
|
#include "sceneRender.h"
|
2004-04-25 05:18:43 +00:00
|
|
|
#include "blendef.h"
|
|
|
|
#include "Scene.h"
|
|
|
|
#include "gen_utils.h"
|
2004-10-07 19:25:40 +00:00
|
|
|
|
2004-04-25 05:18:43 +00:00
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
2004-09-25 20:30:40 +00:00
|
|
|
#include <config.h>
|
2004-03-14 02:06:57 +00:00
|
|
|
#endif
|
|
|
|
|
2004-04-25 05:18:43 +00:00
|
|
|
//local defines
|
|
|
|
#define PY_NONE 0
|
|
|
|
#define PY_LOW 1
|
|
|
|
#define PY_MEDIUM 2
|
|
|
|
#define PY_HIGH 3
|
|
|
|
#define PY_HIGHER 4
|
|
|
|
#define PY_BEST 5
|
|
|
|
#define PY_SKYDOME 1
|
|
|
|
#define PY_FULL 2
|
2004-03-14 02:06:57 +00:00
|
|
|
|
2004-11-14 01:03:01 +00:00
|
|
|
extern RE_Render R;
|
2004-03-14 02:06:57 +00:00
|
|
|
|
2004-09-25 20:30:40 +00:00
|
|
|
//---------------------------------------Render prototypes-------------
|
|
|
|
static PyObject *M_Render_CloseRenderWindow( PyObject * self );
|
|
|
|
static PyObject *M_Render_EnableDispView( PyObject * self );
|
|
|
|
static PyObject *M_Render_EnableDispWin( PyObject * self );
|
|
|
|
static PyObject *M_Render_SetRenderWinPos( PyObject * self, PyObject * args );
|
|
|
|
static PyObject *M_Render_EnableEdgeShift( PyObject * self, PyObject * args );
|
|
|
|
static PyObject *M_Render_EnableEdgeAll( PyObject * self, PyObject * args );
|
|
|
|
//----------------------------------------------Render doc strings------
|
2004-04-25 05:18:43 +00:00
|
|
|
static char M_Render_doc[] = "The Blender Render module";
|
2004-09-25 20:30:40 +00:00
|
|
|
//----------------------------------------------Render method def-------
|
2004-04-25 05:18:43 +00:00
|
|
|
struct PyMethodDef M_Render_methods[] = {
|
2004-09-25 20:30:40 +00:00
|
|
|
{"CloseRenderWindow", ( PyCFunction ) M_Render_CloseRenderWindow,
|
|
|
|
METH_NOARGS,
|
|
|
|
"() - close the rendering window\n"},
|
|
|
|
{"EnableDispView", ( PyCFunction ) M_Render_EnableDispView,
|
|
|
|
METH_NOARGS,
|
|
|
|
"(bool) - enable Sceneing in view\n"},
|
|
|
|
{"EnableDispWin", ( PyCFunction ) M_Render_EnableDispWin, METH_NOARGS,
|
|
|
|
"(bool) - enable Sceneing in new window\n"},
|
|
|
|
{"SetRenderWinPos", ( PyCFunction ) M_Render_SetRenderWinPos,
|
|
|
|
METH_VARARGS,
|
|
|
|
"([string list]) - position the rendering window in around the edge of the screen\n"},
|
|
|
|
{"EnableEdgeShift", ( PyCFunction ) M_Render_EnableEdgeShift,
|
|
|
|
METH_VARARGS,
|
|
|
|
"(bool) - with the unified renderer the outlines are shifted a bit.\n"},
|
|
|
|
{"EnableEdgeAll", ( PyCFunction ) M_Render_EnableEdgeAll, METH_VARARGS,
|
|
|
|
"(bool) - also consider transparent faces for edge-rendering with the unified renderer\n"},
|
|
|
|
{NULL, NULL, 0, NULL}
|
2004-04-25 05:18:43 +00:00
|
|
|
};
|
2004-09-25 20:30:40 +00:00
|
|
|
//------------------------------------BPy_RenderData methods/callbacks--
|
|
|
|
static PyObject *RenderData_Render( BPy_RenderData * self );
|
|
|
|
static PyObject *RenderData_RenderAnim( BPy_RenderData * self );
|
|
|
|
static PyObject *RenderData_Play( BPy_RenderData * self );
|
|
|
|
static PyObject *RenderData_SetRenderPath( BPy_RenderData * self,
|
|
|
|
PyObject * args );
|
|
|
|
static PyObject *RenderData_GetRenderPath( BPy_RenderData * self );
|
|
|
|
static PyObject *RenderData_SetBackbufPath( BPy_RenderData * self,
|
|
|
|
PyObject * args );
|
|
|
|
static PyObject *RenderData_GetBackbufPath( BPy_RenderData * self );
|
|
|
|
static PyObject *RenderData_EnableBackbuf( BPy_RenderData * self,
|
|
|
|
PyObject * args );
|
|
|
|
static PyObject *RenderData_SetFtypePath( BPy_RenderData * self,
|
|
|
|
PyObject * args );
|
|
|
|
static PyObject *RenderData_GetFtypePath( BPy_RenderData * self );
|
|
|
|
static PyObject *RenderData_EnableExtensions( BPy_RenderData * self,
|
|
|
|
PyObject * args );
|
|
|
|
static PyObject *RenderData_EnableSequencer( BPy_RenderData * self,
|
|
|
|
PyObject * args );
|
|
|
|
static PyObject *RenderData_EnableRenderDaemon( BPy_RenderData * self,
|
|
|
|
PyObject * args );
|
|
|
|
static PyObject *RenderData_EnableToonShading( BPy_RenderData * self,
|
|
|
|
PyObject * args );
|
|
|
|
static PyObject *RenderData_EdgeIntensity( BPy_RenderData * self,
|
|
|
|
PyObject * args );
|
|
|
|
static PyObject *RenderData_SetEdgeColor( BPy_RenderData * self,
|
|
|
|
PyObject * args );
|
|
|
|
static PyObject *RenderData_GetEdgeColor( BPy_RenderData * self );
|
|
|
|
static PyObject *RenderData_EdgeAntiShift( BPy_RenderData * self,
|
|
|
|
PyObject * args );
|
|
|
|
static PyObject *RenderData_EnableOversampling( BPy_RenderData * self,
|
|
|
|
PyObject * args );
|
|
|
|
static PyObject *RenderData_SetOversamplingLevel( BPy_RenderData * self,
|
|
|
|
PyObject * args );
|
|
|
|
static PyObject *RenderData_EnableMotionBlur( BPy_RenderData * self,
|
|
|
|
PyObject * args );
|
|
|
|
static PyObject *RenderData_MotionBlurLevel( BPy_RenderData * self,
|
|
|
|
PyObject * args );
|
|
|
|
static PyObject *RenderData_PartsX( BPy_RenderData * self, PyObject * args );
|
|
|
|
static PyObject *RenderData_PartsY( BPy_RenderData * self, PyObject * args );
|
|
|
|
static PyObject *RenderData_EnableSky( BPy_RenderData * self );
|
|
|
|
static PyObject *RenderData_EnablePremultiply( BPy_RenderData * self );
|
|
|
|
static PyObject *RenderData_EnableKey( BPy_RenderData * self );
|
|
|
|
static PyObject *RenderData_EnableShadow( BPy_RenderData * self,
|
|
|
|
PyObject * args );
|
|
|
|
static PyObject *RenderData_EnablePanorama( BPy_RenderData * self,
|
|
|
|
PyObject * args );
|
|
|
|
static PyObject *RenderData_EnableEnvironmentMap( BPy_RenderData * self,
|
|
|
|
PyObject * args );
|
|
|
|
static PyObject *RenderData_EnableRayTracing( BPy_RenderData * self,
|
|
|
|
PyObject * args );
|
|
|
|
static PyObject *RenderData_EnableRadiosityRender( BPy_RenderData * self,
|
|
|
|
PyObject * args );
|
|
|
|
static PyObject *RenderData_SetRenderWinSize( BPy_RenderData * self,
|
|
|
|
PyObject * args );
|
|
|
|
static PyObject *RenderData_EnableFieldRendering( BPy_RenderData * self,
|
|
|
|
PyObject * args );
|
|
|
|
static PyObject *RenderData_EnableOddFieldFirst( BPy_RenderData * self,
|
|
|
|
PyObject * args );
|
|
|
|
static PyObject *RenderData_EnableFieldTimeDisable( BPy_RenderData * self,
|
|
|
|
PyObject * args );
|
|
|
|
static PyObject *RenderData_EnableGaussFilter( BPy_RenderData * self,
|
|
|
|
PyObject * args );
|
|
|
|
static PyObject *RenderData_EnableBorderRender( BPy_RenderData * self,
|
|
|
|
PyObject * args );
|
|
|
|
static PyObject *RenderData_SetBorder( BPy_RenderData * self,
|
|
|
|
PyObject * args );
|
|
|
|
static PyObject *RenderData_EnableGammaCorrection( BPy_RenderData * self,
|
|
|
|
PyObject * args );
|
|
|
|
static PyObject *RenderData_GaussFilterSize( BPy_RenderData * self,
|
|
|
|
PyObject * args );
|
|
|
|
static PyObject *RenderData_StartFrame( BPy_RenderData * self,
|
|
|
|
PyObject * args );
|
|
|
|
static PyObject *RenderData_CurrentFrame( BPy_RenderData * self,
|
|
|
|
PyObject * args );
|
|
|
|
static PyObject *RenderData_EndFrame( BPy_RenderData * self, PyObject * args );
|
|
|
|
static PyObject *RenderData_ImageSizeX( BPy_RenderData * self,
|
|
|
|
PyObject * args );
|
|
|
|
static PyObject *RenderData_ImageSizeY( BPy_RenderData * self,
|
|
|
|
PyObject * args );
|
|
|
|
static PyObject *RenderData_AspectRatioX( BPy_RenderData * self,
|
|
|
|
PyObject * args );
|
|
|
|
static PyObject *RenderData_AspectRatioY( BPy_RenderData * self,
|
|
|
|
PyObject * args );
|
|
|
|
static PyObject *RenderData_SetRenderer( BPy_RenderData * self,
|
|
|
|
PyObject * args );
|
|
|
|
static PyObject *RenderData_EnableCropping( BPy_RenderData * self,
|
|
|
|
PyObject * args );
|
|
|
|
static PyObject *RenderData_SetImageType( BPy_RenderData * self,
|
|
|
|
PyObject * args );
|
|
|
|
static PyObject *RenderData_Quality( BPy_RenderData * self, PyObject * args );
|
|
|
|
static PyObject *RenderData_FramesPerSec( BPy_RenderData * self,
|
|
|
|
PyObject * args );
|
|
|
|
static PyObject *RenderData_EnableGrayscale( BPy_RenderData * self );
|
|
|
|
static PyObject *RenderData_EnableRGBColor( BPy_RenderData * self );
|
|
|
|
static PyObject *RenderData_EnableRGBAColor( BPy_RenderData * self );
|
|
|
|
static PyObject *RenderData_SizePreset( BPy_RenderData * self,
|
|
|
|
PyObject * args );
|
|
|
|
static PyObject *RenderData_EnableUnifiedRenderer( BPy_RenderData * self,
|
|
|
|
PyObject * args );
|
|
|
|
static PyObject *RenderData_SetYafrayGIQuality( BPy_RenderData * self,
|
|
|
|
PyObject * args );
|
|
|
|
static PyObject *RenderData_SetYafrayGIMethod( BPy_RenderData * self,
|
|
|
|
PyObject * args );
|
|
|
|
static PyObject *RenderData_YafrayGIPower( BPy_RenderData * self,
|
|
|
|
PyObject * args );
|
|
|
|
static PyObject *RenderData_YafrayGIDepth( BPy_RenderData * self,
|
|
|
|
PyObject * args );
|
|
|
|
static PyObject *RenderData_YafrayGICDepth( BPy_RenderData * self,
|
|
|
|
PyObject * args );
|
|
|
|
static PyObject *RenderData_EnableYafrayGICache( BPy_RenderData * self,
|
|
|
|
PyObject * args );
|
|
|
|
static PyObject *RenderData_EnableYafrayGIPhotons( BPy_RenderData * self,
|
|
|
|
PyObject * args );
|
|
|
|
static PyObject *RenderData_YafrayGIPhotonCount( BPy_RenderData * self,
|
|
|
|
PyObject * args );
|
|
|
|
static PyObject *RenderData_YafrayGIPhotonRadius( BPy_RenderData * self,
|
|
|
|
PyObject * args );
|
|
|
|
static PyObject *RenderData_YafrayGIPhotonMixCount( BPy_RenderData * self,
|
|
|
|
PyObject * args );
|
|
|
|
static PyObject *RenderData_EnableYafrayGITunePhotons( BPy_RenderData * self,
|
|
|
|
PyObject * args );
|
|
|
|
static PyObject *RenderData_YafrayGIShadowQuality( BPy_RenderData * self,
|
|
|
|
PyObject * args );
|
|
|
|
static PyObject *RenderData_YafrayGIPixelsPerSample( BPy_RenderData * self,
|
|
|
|
PyObject * args );
|
|
|
|
static PyObject *RenderData_YafrayGIRefinement( BPy_RenderData * self,
|
|
|
|
PyObject * args );
|
|
|
|
static PyObject *RenderData_YafrayRayBias( BPy_RenderData * self,
|
|
|
|
PyObject * args );
|
|
|
|
static PyObject *RenderData_YafrayRayDepth( BPy_RenderData * self,
|
|
|
|
PyObject * args );
|
|
|
|
static PyObject *RenderData_YafrayGamma( BPy_RenderData * self,
|
|
|
|
PyObject * args );
|
|
|
|
static PyObject *RenderData_YafrayExposure( BPy_RenderData * self,
|
|
|
|
PyObject * args );
|
|
|
|
static PyObject *RenderData_YafrayProcessorCount( BPy_RenderData * self,
|
|
|
|
PyObject * args );
|
|
|
|
static PyObject *RenderData_EnableGameFrameStretch( BPy_RenderData * self );
|
|
|
|
static PyObject *RenderData_EnableGameFrameExpose( BPy_RenderData * self );
|
|
|
|
static PyObject *RenderData_EnableGameFrameBars( BPy_RenderData * self );
|
|
|
|
static PyObject *RenderData_SetGameFrameColor( BPy_RenderData * self,
|
|
|
|
PyObject * args );
|
|
|
|
static PyObject *RenderData_GetGameFrameColor( BPy_RenderData * self );
|
|
|
|
static PyObject *RenderData_GammaLevel( BPy_RenderData * self,
|
|
|
|
PyObject * args );
|
|
|
|
static PyObject *RenderData_PostProcessAdd( BPy_RenderData * self,
|
|
|
|
PyObject * args );
|
|
|
|
static PyObject *RenderData_PostProcessMultiply( BPy_RenderData * self,
|
|
|
|
PyObject * args );
|
|
|
|
static PyObject *RenderData_PostProcessGamma( BPy_RenderData * self,
|
|
|
|
PyObject * args );
|
|
|
|
static PyObject *RenderData_SGIMaxsize( BPy_RenderData * self,
|
|
|
|
PyObject * args );
|
|
|
|
static PyObject *RenderData_EnableSGICosmo( BPy_RenderData * self,
|
|
|
|
PyObject * args );
|
|
|
|
static PyObject *RenderData_OldMapValue( BPy_RenderData * self,
|
|
|
|
PyObject * args );
|
|
|
|
static PyObject *RenderData_NewMapValue( BPy_RenderData * self,
|
|
|
|
PyObject * args );
|
|
|
|
|
|
|
|
static void RenderData_dealloc( BPy_RenderData * self );
|
|
|
|
static PyObject *RenderData_getAttr( BPy_RenderData * self, char *name );
|
|
|
|
static PyObject *RenderData_repr( BPy_RenderData * self );
|
|
|
|
//------------------------------------BPy_RenderData method def--------
|
2004-04-25 05:18:43 +00:00
|
|
|
static PyMethodDef BPy_RenderData_methods[] = {
|
2004-09-25 20:30:40 +00:00
|
|
|
{"render", ( PyCFunction ) RenderData_Render, METH_NOARGS,
|
|
|
|
"() - render the scene\n"},
|
|
|
|
{"renderAnim", ( PyCFunction ) RenderData_RenderAnim, METH_NOARGS,
|
|
|
|
"() - render a sequence from start frame to end frame\n"},
|
|
|
|
{"play", ( PyCFunction ) RenderData_Play, METH_NOARGS,
|
|
|
|
"() - play animation of rendered images/avi (searches Pics: field)\n"},
|
|
|
|
{"setRenderPath", ( PyCFunction ) RenderData_SetRenderPath,
|
|
|
|
METH_VARARGS,
|
|
|
|
"(string) - get/set the path to output the rendered images to\n"},
|
|
|
|
{"getRenderPath", ( PyCFunction ) RenderData_GetRenderPath,
|
|
|
|
METH_NOARGS,
|
|
|
|
"() - get the path to directory where rendered images will go\n"},
|
|
|
|
{"setBackbufPath", ( PyCFunction ) RenderData_SetBackbufPath,
|
|
|
|
METH_VARARGS,
|
|
|
|
"(string) - get/set the path to a background image and load it\n"},
|
|
|
|
{"getBackbufPath", ( PyCFunction ) RenderData_GetBackbufPath,
|
|
|
|
METH_NOARGS,
|
|
|
|
"() - get the path to background image file\n"},
|
|
|
|
{"enableBackbuf", ( PyCFunction ) RenderData_EnableBackbuf,
|
|
|
|
METH_VARARGS,
|
|
|
|
"(bool) - enable/disable the backbuf image\n"},
|
|
|
|
{"setFtypePath", ( PyCFunction ) RenderData_SetFtypePath, METH_VARARGS,
|
|
|
|
"(string) - get/set the path to output the Ftype file\n"},
|
|
|
|
{"getFtypePath", ( PyCFunction ) RenderData_GetFtypePath, METH_NOARGS,
|
|
|
|
"() - get the path to Ftype file\n"},
|
|
|
|
{"enableExtensions", ( PyCFunction ) RenderData_EnableExtensions,
|
|
|
|
METH_VARARGS,
|
|
|
|
"(bool) - enable/disable windows extensions for output files\n"},
|
|
|
|
{"enableSequencer", ( PyCFunction ) RenderData_EnableSequencer,
|
|
|
|
METH_VARARGS,
|
|
|
|
"(bool) - enable/disable Do Sequence\n"},
|
|
|
|
{"enableRenderDaemon", ( PyCFunction ) RenderData_EnableRenderDaemon,
|
|
|
|
METH_VARARGS,
|
|
|
|
"(bool) - enable/disable Scene daemon\n"},
|
|
|
|
{"enableToonShading", ( PyCFunction ) RenderData_EnableToonShading,
|
|
|
|
METH_VARARGS,
|
|
|
|
"(bool) - enable/disable Edge rendering\n"},
|
|
|
|
{"edgeIntensity", ( PyCFunction ) RenderData_EdgeIntensity,
|
|
|
|
METH_VARARGS,
|
|
|
|
"(int) - get/set edge intensity for toon shading\n"},
|
|
|
|
{"setEdgeColor", ( PyCFunction ) RenderData_SetEdgeColor, METH_VARARGS,
|
|
|
|
"(f,f,f) - set the edge color for toon shading - Red,Green,Blue expected.\n"},
|
|
|
|
{"getEdgeColor", ( PyCFunction ) RenderData_GetEdgeColor, METH_VARARGS,
|
|
|
|
"() - get the edge color for toon shading - Red,Green,Blue expected.\n"},
|
|
|
|
{"edgeAntiShift", ( PyCFunction ) RenderData_EdgeAntiShift,
|
|
|
|
METH_VARARGS,
|
|
|
|
"(int) - with the unified renderer to reduce intensity on boundaries.\n"},
|
|
|
|
{"enableOversampling", ( PyCFunction ) RenderData_EnableOversampling,
|
|
|
|
METH_VARARGS,
|
|
|
|
"(bool) - enable/disable oversampling (anit-aliasing).\n"},
|
|
|
|
{"setOversamplingLevel",
|
|
|
|
( PyCFunction ) RenderData_SetOversamplingLevel, METH_VARARGS,
|
|
|
|
"(enum) - get/set the level of oversampling (anit-aliasing).\n"},
|
|
|
|
{"enableMotionBlur", ( PyCFunction ) RenderData_EnableMotionBlur,
|
|
|
|
METH_VARARGS,
|
|
|
|
"(bool) - enable/disable MBlur.\n"},
|
|
|
|
{"motionBlurLevel", ( PyCFunction ) RenderData_MotionBlurLevel,
|
|
|
|
METH_VARARGS,
|
|
|
|
"(float) - get/set the length of shutter time for motion blur.\n"},
|
|
|
|
{"partsX", ( PyCFunction ) RenderData_PartsX, METH_VARARGS,
|
|
|
|
"(int) - get/set the number of parts to divide the render in the X direction\n"},
|
|
|
|
{"partsY", ( PyCFunction ) RenderData_PartsY, METH_VARARGS,
|
|
|
|
"(int) - get/set the number of parts to divide the render in the Y direction\n"},
|
|
|
|
{"enableSky", ( PyCFunction ) RenderData_EnableSky, METH_NOARGS,
|
|
|
|
"() - enable render background with sky\n"},
|
|
|
|
{"enablePremultiply", ( PyCFunction ) RenderData_EnablePremultiply,
|
|
|
|
METH_NOARGS,
|
|
|
|
"() - enable premultiply alpha\n"},
|
|
|
|
{"enableKey", ( PyCFunction ) RenderData_EnableKey, METH_NOARGS,
|
|
|
|
"() - enable alpha and colour values remain unchanged\n"},
|
|
|
|
{"enableShadow", ( PyCFunction ) RenderData_EnableShadow, METH_VARARGS,
|
|
|
|
"(bool) - enable/disable shadow calculation\n"},
|
|
|
|
{"enablePanorama", ( PyCFunction ) RenderData_EnablePanorama,
|
|
|
|
METH_VARARGS,
|
|
|
|
"(bool) - enable/disable panorama rendering (output width is multiplied by Xparts)\n"},
|
|
|
|
{"enableEnvironmentMap",
|
|
|
|
( PyCFunction ) RenderData_EnableEnvironmentMap, METH_VARARGS,
|
|
|
|
"(bool) - enable/disable environment map rendering\n"},
|
|
|
|
{"enableRayTracing", ( PyCFunction ) RenderData_EnableRayTracing,
|
|
|
|
METH_VARARGS,
|
|
|
|
"(bool) - enable/disable ray tracing\n"},
|
|
|
|
{"enableRadiosityRender",
|
|
|
|
( PyCFunction ) RenderData_EnableRadiosityRender, METH_VARARGS,
|
|
|
|
"(bool) - enable/disable radiosity rendering\n"},
|
|
|
|
{"setRenderWinSize", ( PyCFunction ) RenderData_SetRenderWinSize,
|
|
|
|
METH_VARARGS,
|
|
|
|
"(enum) - get/set the size of the render window\n"},
|
|
|
|
{"enableFieldRendering",
|
|
|
|
( PyCFunction ) RenderData_EnableFieldRendering, METH_VARARGS,
|
|
|
|
"(bool) - enable/disable field rendering\n"},
|
|
|
|
{"enableOddFieldFirst", ( PyCFunction ) RenderData_EnableOddFieldFirst,
|
|
|
|
METH_VARARGS,
|
|
|
|
"(bool) - enable/disable Odd field first rendering (Default: Even field)\n"},
|
|
|
|
{"enableFieldTimeDisable",
|
|
|
|
( PyCFunction ) RenderData_EnableFieldTimeDisable, METH_VARARGS,
|
|
|
|
"(bool) - enable/disable time difference in field calculations\n"},
|
|
|
|
{"enableGaussFilter", ( PyCFunction ) RenderData_EnableGaussFilter,
|
|
|
|
METH_VARARGS,
|
|
|
|
"(bool) - enable/disable Gauss sampling filter for antialiasing\n"},
|
|
|
|
{"enableBorderRender", ( PyCFunction ) RenderData_EnableBorderRender,
|
|
|
|
METH_VARARGS,
|
|
|
|
"(bool) - enable/disable small cut-out rendering\n"},
|
|
|
|
{"setBorder", ( PyCFunction ) RenderData_SetBorder, METH_VARARGS,
|
|
|
|
"(f,f,f,f) - set the border for border rendering\n"},
|
|
|
|
{"enableGammaCorrection",
|
|
|
|
( PyCFunction ) RenderData_EnableGammaCorrection, METH_VARARGS,
|
|
|
|
"(bool) - enable/disable gamma correction\n"},
|
|
|
|
{"gaussFilterSize", ( PyCFunction ) RenderData_GaussFilterSize,
|
|
|
|
METH_VARARGS,
|
|
|
|
"(float) - get/sets the Gauss filter size\n"},
|
|
|
|
{"startFrame", ( PyCFunction ) RenderData_StartFrame, METH_VARARGS,
|
|
|
|
"(int) - get/set the starting frame for rendering\n"},
|
|
|
|
{"currentFrame", ( PyCFunction ) RenderData_CurrentFrame, METH_VARARGS,
|
|
|
|
"(int) - get/set the current frame for rendering\n"},
|
|
|
|
{"endFrame", ( PyCFunction ) RenderData_EndFrame, METH_VARARGS,
|
|
|
|
"(int) - get/set the ending frame for rendering\n"},
|
|
|
|
{"imageSizeX", ( PyCFunction ) RenderData_ImageSizeX, METH_VARARGS,
|
|
|
|
"(int) - get/set the image width in pixels\n"},
|
|
|
|
{"imageSizeY", ( PyCFunction ) RenderData_ImageSizeY, METH_VARARGS,
|
|
|
|
"(int) - get/set the image height in pixels\n"},
|
|
|
|
{"aspectRatioX", ( PyCFunction ) RenderData_AspectRatioX, METH_VARARGS,
|
|
|
|
"(int) - get/set the horizontal aspect ratio\n"},
|
|
|
|
{"aspectRatioY", ( PyCFunction ) RenderData_AspectRatioY, METH_VARARGS,
|
|
|
|
"(int) - get/set the vertical aspect ratio\n"},
|
|
|
|
{"setRenderer", ( PyCFunction ) RenderData_SetRenderer, METH_VARARGS,
|
|
|
|
"(enum) - get/set which renderer to render the output\n"},
|
|
|
|
{"enableCropping", ( PyCFunction ) RenderData_EnableCropping,
|
|
|
|
METH_VARARGS,
|
|
|
|
"(bool) - enable/disable exclusion of border rendering from total image\n"},
|
|
|
|
{"setImageType", ( PyCFunction ) RenderData_SetImageType, METH_VARARGS,
|
|
|
|
"(enum) - get/set the type of image to output from the render\n"},
|
|
|
|
{"quality", ( PyCFunction ) RenderData_Quality, METH_VARARGS,
|
|
|
|
"(int) - get/set quality get/setting for JPEG images, AVI Jpeg and SGI movies\n"},
|
|
|
|
{"framesPerSec", ( PyCFunction ) RenderData_FramesPerSec, METH_VARARGS,
|
|
|
|
"(int) - get/set frames per second\n"},
|
|
|
|
{"enableGrayscale", ( PyCFunction ) RenderData_EnableGrayscale,
|
|
|
|
METH_NOARGS,
|
|
|
|
"() - images are saved with BW (grayscale) data\n"},
|
|
|
|
{"enableRGBColor", ( PyCFunction ) RenderData_EnableRGBColor,
|
|
|
|
METH_NOARGS,
|
|
|
|
"() - images are saved with RGB (color) data\n"},
|
|
|
|
{"enableRGBAColor", ( PyCFunction ) RenderData_EnableRGBAColor,
|
|
|
|
METH_NOARGS,
|
|
|
|
"() - images are saved with RGB and Alpha data (if supported)\n"},
|
|
|
|
{"sizePreset", ( PyCFunction ) RenderData_SizePreset, METH_VARARGS,
|
|
|
|
"(enum) - get/set the render to one of a few preget/sets\n"},
|
|
|
|
{"enableUnifiedRenderer",
|
|
|
|
( PyCFunction ) RenderData_EnableUnifiedRenderer, METH_VARARGS,
|
|
|
|
"(bool) - use the unified renderer\n"},
|
|
|
|
{"setYafrayGIQuality", ( PyCFunction ) RenderData_SetYafrayGIQuality,
|
|
|
|
METH_VARARGS,
|
|
|
|
"(enum) - get/set yafray global Illumination quality\n"},
|
|
|
|
{"setYafrayGIMethod", ( PyCFunction ) RenderData_SetYafrayGIMethod,
|
|
|
|
METH_VARARGS,
|
|
|
|
"(enum) - get/set yafray global Illumination method\n"},
|
|
|
|
{"yafrayGIPower", ( PyCFunction ) RenderData_YafrayGIPower,
|
|
|
|
METH_VARARGS,
|
|
|
|
"(float) - get/set GI lighting intensity scale\n"},
|
|
|
|
{"yafrayGIDepth", ( PyCFunction ) RenderData_YafrayGIDepth,
|
|
|
|
METH_VARARGS,
|
|
|
|
"(int) - get/set number of bounces of the indirect light\n"},
|
|
|
|
{"yafrayGICDepth", ( PyCFunction ) RenderData_YafrayGICDepth,
|
|
|
|
METH_VARARGS,
|
|
|
|
"(int) - get/set number of bounces inside objects (for caustics)\n"},
|
|
|
|
{"enableYafrayGICache", ( PyCFunction ) RenderData_EnableYafrayGICache,
|
|
|
|
METH_VARARGS,
|
|
|
|
"(bool) - enable/disable cache irradiance samples (faster)\n"},
|
|
|
|
{"enableYafrayGIPhotons",
|
|
|
|
( PyCFunction ) RenderData_EnableYafrayGIPhotons, METH_VARARGS,
|
|
|
|
"(bool) - enable/disable use global photons to help in GI\n"},
|
|
|
|
{"yafrayGIPhotonCount", ( PyCFunction ) RenderData_YafrayGIPhotonCount,
|
|
|
|
METH_VARARGS,
|
|
|
|
"(int) - get/set number of photons to shoot\n"},
|
|
|
|
{"yafrayGIPhotonRadius",
|
|
|
|
( PyCFunction ) RenderData_YafrayGIPhotonRadius, METH_VARARGS,
|
|
|
|
"(float) - get/set radius to search for photons to mix (blur)\n"},
|
|
|
|
{"yafrayGIPhotonMixCount",
|
|
|
|
( PyCFunction ) RenderData_YafrayGIPhotonMixCount, METH_VARARGS,
|
|
|
|
"(int) - get/set number of photons to shoot\n"},
|
|
|
|
{"enableYafrayGITunePhotons",
|
|
|
|
( PyCFunction ) RenderData_EnableYafrayGITunePhotons, METH_VARARGS,
|
|
|
|
"(bool) - enable/disable show the photonmap directly in the render for tuning\n"},
|
|
|
|
{"yafrayGIShadowQuality",
|
|
|
|
( PyCFunction ) RenderData_YafrayGIShadowQuality, METH_VARARGS,
|
|
|
|
"(float) - get/set the shadow quality, keep it under 0.95\n"},
|
|
|
|
{"yafrayGIPixelsPerSample",
|
|
|
|
( PyCFunction ) RenderData_YafrayGIPixelsPerSample, METH_VARARGS,
|
|
|
|
"(int) - get/set maximum number of pixels without samples, the lower the better and slower\n"},
|
|
|
|
{"yafrayGIRefinement", ( PyCFunction ) RenderData_YafrayGIRefinement,
|
|
|
|
METH_VARARGS,
|
|
|
|
"(float) - get/setthreshold to refine shadows EXPERIMENTAL. 1 = no refinement\n"},
|
|
|
|
{"yafrayRayBias", ( PyCFunction ) RenderData_YafrayRayBias,
|
|
|
|
METH_VARARGS,
|
|
|
|
"(float) - get/set shadow ray bias to avoid self shadowing\n"},
|
|
|
|
{"yafrayRayDepth", ( PyCFunction ) RenderData_YafrayRayDepth,
|
|
|
|
METH_VARARGS,
|
|
|
|
"(int) - get/set maximum render ray depth from the camera\n"},
|
|
|
|
{"yafrayGamma", ( PyCFunction ) RenderData_YafrayGamma, METH_VARARGS,
|
|
|
|
"(float) - get/set gamma correction, 1 is off\n"},
|
|
|
|
{"yafrayExposure", ( PyCFunction ) RenderData_YafrayExposure,
|
|
|
|
METH_VARARGS,
|
|
|
|
"(float) - get/set exposure adjustment, 0 is off\n"},
|
|
|
|
{"yafrayProcessorCount",
|
|
|
|
( PyCFunction ) RenderData_YafrayProcessorCount, METH_VARARGS,
|
|
|
|
"(int) - get/set number of processors to use\n"},
|
|
|
|
{"enableGameFrameStretch",
|
|
|
|
( PyCFunction ) RenderData_EnableGameFrameStretch, METH_NOARGS,
|
|
|
|
"(l) - enble stretch or squeeze the viewport to fill the display window\n"},
|
|
|
|
{"enableGameFrameExpose",
|
|
|
|
( PyCFunction ) RenderData_EnableGameFrameExpose, METH_NOARGS,
|
|
|
|
"(l) - enable show the entire viewport in the display window, viewing more horizontally or vertically\n"},
|
|
|
|
{"enableGameFrameBars", ( PyCFunction ) RenderData_EnableGameFrameBars,
|
|
|
|
METH_NOARGS,
|
|
|
|
"() - enable show the entire viewport in the display window, using bar horizontally or vertically\n"},
|
|
|
|
{"setGameFrameColor", ( PyCFunction ) RenderData_SetGameFrameColor,
|
|
|
|
METH_VARARGS,
|
|
|
|
"(f,f,f) - set the red, green, blue component of the bars\n"},
|
|
|
|
{"getGameFrameColor", ( PyCFunction ) RenderData_GetGameFrameColor,
|
|
|
|
METH_VARARGS,
|
|
|
|
"() - get the red, green, blue component of the bars\n"},
|
|
|
|
{"gammaLevel", ( PyCFunction ) RenderData_GammaLevel, METH_VARARGS,
|
|
|
|
"(float) - get/set the gamma value for blending oversampled images (1.0 = no correction\n"},
|
|
|
|
{"postProcessAdd", ( PyCFunction ) RenderData_PostProcessAdd,
|
|
|
|
METH_VARARGS,
|
|
|
|
"(float) - get/set post processing add\n"},
|
|
|
|
{"postProcessMultiply", ( PyCFunction ) RenderData_PostProcessMultiply,
|
|
|
|
METH_VARARGS,
|
|
|
|
"(float) - get/set post processing multiply\n"},
|
|
|
|
{"postProcessGamma", ( PyCFunction ) RenderData_PostProcessGamma,
|
|
|
|
METH_VARARGS,
|
|
|
|
"(float) - get/set post processing gamma\n"},
|
|
|
|
{"SGIMaxsize", ( PyCFunction ) RenderData_SGIMaxsize, METH_VARARGS,
|
|
|
|
"(int) - get/set maximum size per frame to save in an SGI movie\n"},
|
|
|
|
{"enableSGICosmo", ( PyCFunction ) RenderData_EnableSGICosmo,
|
|
|
|
METH_VARARGS,
|
|
|
|
"(bool) - enable/disable attempt to save SGI movies using Cosmo hardware\n"},
|
|
|
|
{"oldMapValue", ( PyCFunction ) RenderData_OldMapValue, METH_VARARGS,
|
|
|
|
"(int) - get/set specify old map value in frames\n"},
|
|
|
|
{"newMapValue", ( PyCFunction ) RenderData_NewMapValue, METH_VARARGS,
|
|
|
|
"(int) - get/set specify new map value in frames\n"},
|
|
|
|
{NULL, NULL, 0, NULL}
|
2004-04-25 05:18:43 +00:00
|
|
|
};
|
2004-09-25 20:30:40 +00:00
|
|
|
//------------------------------------BPy_RenderData Type defintion------
|
2004-04-25 05:18:43 +00:00
|
|
|
PyTypeObject RenderData_Type = {
|
2004-09-25 20:30:40 +00:00
|
|
|
PyObject_HEAD_INIT( NULL ) 0, /* ob_size */
|
|
|
|
"Blender RenderData", /* tp_name */
|
|
|
|
sizeof( BPy_RenderData ), /* tp_basicsize */
|
|
|
|
0, /* tp_itemsize */
|
|
|
|
/* methods */
|
|
|
|
( destructor ) RenderData_dealloc, /* tp_dealloc */
|
|
|
|
0, /* tp_print */
|
|
|
|
( getattrfunc ) RenderData_getAttr, /* tp_getattr */
|
|
|
|
0, /* tp_setattr */
|
|
|
|
0, /* tp_compare */
|
|
|
|
( reprfunc ) RenderData_repr, /* tp_repr */
|
|
|
|
0, /* tp_as_number */
|
|
|
|
0, /* tp_as_sequence */
|
|
|
|
0, /* tp_as_mapping */
|
|
|
|
0, /* tp_as_hash */
|
|
|
|
0, 0, 0, 0, 0, 0,
|
|
|
|
0, /* tp_doc */
|
|
|
|
0, 0, 0, 0, 0, 0,
|
|
|
|
BPy_RenderData_methods, /* tp_methods */
|
|
|
|
0, /* tp_members */
|
BPython:
- Scripts:
fixed error in "Save Current Theme" which prevented it from automatically updating script registration in menus.
cosmetic changes in a couple of Campbell's sel_same.py script strings + more descriptive name for its new menu place (3d view, face mode -> select menu).
small updates to help_browser.py script.
The above changes are related to this:
- Added new script menu entries: Render (for exporters to renderers), Themes, FaceSelect (this already at the proper place). Updated Scripts win->Scripts menu so it won't show all available entries, only the ones we mean to see there.
- Updated menu registration so that scripts folders can become trees. The release/scripts/ dir should be updated soon with subdirs like converters/, modifiers/, generators/ or whatever -- better discuss first (or is it? /me afraid of long irc discussions during meetings :) ).
- Modules:
Blender: added 'udatadir' option to .Get() function and added var Blender.mode to tell if Blender is in bg or interactive mode.
NMesh: added Campbell's nmesh.transform(matrix, recalc_normals = False) method (reworked, so my fault if it doesn't work).
- Bugs fixed:
#2123: http://projects.blender.org/tracker/?func=detail&atid=125&aid=2123&group_id=9
Reported by Ken Hughes (thanks!), who also found the exact problem later (it was in Text.Load, not with script links -- if only I had checked emails these days ... lost > 1 hour today to find the problem: passed filename to M_Text_Load was later being written over by a function called by add_text). Also saw that Text.Load wasn't checking existence of passed filename (duh!), now it does.
#1655: http://projects.blender.org/tracker/?func=detail&atid=125&aid=1655&group_id=9
Reported by Chris Want (thanks!): command line "blender -P script" not working properly for bg mode ("blender -b blendfile -P script").
Had to make some small updates to get it working (bg mode for scripts was never explicitely handled, it worked due to collateral effects, let's say), interested readers can check the report after I update it or the API_intro.py doc file. After more testing we can make further updates. Updated many places to not call redraws if in bg mode, now it is officially available. Blender outputs its own info when rendering in bg mode, if that is considered a nuissance we'll have to add a few "if (during_script())" calls outside bpython.
- Removed a few warnings here and there and also updated docs.
2005-03-19 06:24:55 +00:00
|
|
|
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
2004-04-25 05:18:43 +00:00
|
|
|
};
|
2004-09-25 20:30:40 +00:00
|
|
|
//---------------------------------------------------Render Module Init--
|
|
|
|
PyObject *Render_Init( void )
|
|
|
|
{
|
|
|
|
PyObject *submodule;
|
|
|
|
|
|
|
|
RenderData_Type.ob_type = &PyType_Type;
|
|
|
|
|
|
|
|
submodule = Py_InitModule3( "Blender.Scene.Render",
|
|
|
|
M_Render_methods, M_Render_doc );
|
|
|
|
|
|
|
|
PyModule_AddIntConstant( submodule, "INTERNAL", R_INTERN );
|
|
|
|
PyModule_AddIntConstant( submodule, "YAFRAY", R_YAFRAY );
|
|
|
|
PyModule_AddIntConstant( submodule, "AVIRAW", R_AVIRAW );
|
|
|
|
PyModule_AddIntConstant( submodule, "AVIJPEG", R_AVIJPEG );
|
|
|
|
PyModule_AddIntConstant( submodule, "AVICODEC", R_AVICODEC );
|
|
|
|
PyModule_AddIntConstant( submodule, "QUICKTIME", R_QUICKTIME );
|
|
|
|
PyModule_AddIntConstant( submodule, "TARGA", R_TARGA );
|
|
|
|
PyModule_AddIntConstant( submodule, "RAWTGA", R_RAWTGA );
|
|
|
|
PyModule_AddIntConstant( submodule, "PNG", R_PNG );
|
|
|
|
PyModule_AddIntConstant( submodule, "BMP", R_BMP );
|
|
|
|
PyModule_AddIntConstant( submodule, "JPEG", R_JPEG90 );
|
|
|
|
PyModule_AddIntConstant( submodule, "HAMX", R_HAMX );
|
|
|
|
PyModule_AddIntConstant( submodule, "IRIS", R_IRIS );
|
|
|
|
PyModule_AddIntConstant( submodule, "IRISZ", R_IRIZ );
|
|
|
|
PyModule_AddIntConstant( submodule, "FTYPE", R_FTYPE );
|
|
|
|
PyModule_AddIntConstant( submodule, "PAL", B_PR_PAL );
|
|
|
|
PyModule_AddIntConstant( submodule, "NTSC", B_PR_NTSC );
|
|
|
|
PyModule_AddIntConstant( submodule, "DEFAULT", B_PR_PRESET );
|
|
|
|
PyModule_AddIntConstant( submodule, "PREVIEW", B_PR_PRV );
|
|
|
|
PyModule_AddIntConstant( submodule, "PC", B_PR_PC );
|
|
|
|
PyModule_AddIntConstant( submodule, "PAL169", B_PR_PAL169 );
|
|
|
|
PyModule_AddIntConstant( submodule, "PANO", B_PR_PANO );
|
|
|
|
PyModule_AddIntConstant( submodule, "FULL", B_PR_FULL );
|
|
|
|
PyModule_AddIntConstant( submodule, "NONE", PY_NONE );
|
|
|
|
PyModule_AddIntConstant( submodule, "LOW", PY_LOW );
|
|
|
|
PyModule_AddIntConstant( submodule, "MEDIUM", PY_MEDIUM );
|
|
|
|
PyModule_AddIntConstant( submodule, "HIGH", PY_HIGH );
|
|
|
|
PyModule_AddIntConstant( submodule, "HIGHER", PY_HIGHER );
|
|
|
|
PyModule_AddIntConstant( submodule, "BEST", PY_BEST );
|
|
|
|
PyModule_AddIntConstant( submodule, "SKYDOME", PY_SKYDOME );
|
|
|
|
PyModule_AddIntConstant( submodule, "GIFULL", PY_FULL );
|
|
|
|
|
|
|
|
return ( submodule );
|
|
|
|
}
|
|
|
|
|
|
|
|
//-----------------------------------BPy_RenderData Internal Protocols---
|
|
|
|
//-------------------------------------------------dealloc---------------
|
|
|
|
static void RenderData_dealloc( BPy_RenderData * self )
|
|
|
|
{
|
|
|
|
PyObject_DEL( self );
|
|
|
|
}
|
|
|
|
|
|
|
|
//-------------------------------------------------getAttr---------------
|
|
|
|
static PyObject *RenderData_getAttr( BPy_RenderData * self, char *name )
|
|
|
|
{
|
|
|
|
return Py_FindMethod( BPy_RenderData_methods, ( PyObject * ) self,
|
|
|
|
name );
|
|
|
|
}
|
|
|
|
|
|
|
|
//-------------------------------------------------repr------------------
|
|
|
|
static PyObject *RenderData_repr( BPy_RenderData * self )
|
|
|
|
{
|
|
|
|
if( self->renderContext )
|
|
|
|
return PyString_FromFormat( "[RenderData \"%s\"]",
|
|
|
|
self->scene->id.name + 2 );
|
|
|
|
else
|
|
|
|
return PyString_FromString( "NULL" );
|
|
|
|
}
|
|
|
|
|
|
|
|
//------------------------------BPy_RenderData Callbacks-----------------
|
|
|
|
//--------------------------------------CreatePyObject-------------------
|
|
|
|
PyObject *RenderData_CreatePyObject( struct Scene * scene )
|
|
|
|
{
|
|
|
|
BPy_RenderData *py_renderdata;
|
|
|
|
|
|
|
|
py_renderdata =
|
|
|
|
( BPy_RenderData * ) PyObject_NEW( BPy_RenderData,
|
|
|
|
&RenderData_Type );
|
|
|
|
|
|
|
|
if( py_renderdata == NULL ) {
|
|
|
|
return ( NULL );
|
|
|
|
}
|
|
|
|
py_renderdata->renderContext = &scene->r;
|
|
|
|
py_renderdata->scene = scene;
|
|
|
|
|
|
|
|
return ( ( PyObject * ) py_renderdata );
|
|
|
|
}
|
|
|
|
|
|
|
|
//------------------------------CheckPyObject----------------------------
|
|
|
|
int RenderData_CheckPyObject( PyObject * py_obj )
|
|
|
|
{
|
|
|
|
return ( py_obj->ob_type == &RenderData_Type );
|
|
|
|
}
|
|
|
|
|
|
|
|
//------------------------------------BitToggleInt-----------------------
|
|
|
|
static PyObject *M_Render_BitToggleInt( PyObject * args, int setting,
|
|
|
|
int *structure )
|
2004-03-14 02:06:57 +00:00
|
|
|
{
|
|
|
|
int flag;
|
|
|
|
|
2004-09-25 20:30:40 +00:00
|
|
|
if( !PyArg_ParseTuple( args, "i", &flag ) )
|
|
|
|
return ( EXPP_ReturnPyObjError
|
|
|
|
( PyExc_AttributeError,
|
|
|
|
"expected TRUE or FALSE (1 or 0)" ) );
|
2004-03-14 02:06:57 +00:00
|
|
|
|
2004-09-25 20:30:40 +00:00
|
|
|
if( flag < 0 || flag > 1 )
|
|
|
|
return ( EXPP_ReturnPyObjError
|
|
|
|
( PyExc_AttributeError,
|
|
|
|
"expected TRUE or FALSE (1 or 0)" ) );
|
2004-03-14 02:06:57 +00:00
|
|
|
|
2004-09-25 20:30:40 +00:00
|
|
|
if( flag )
|
2004-03-14 02:06:57 +00:00
|
|
|
*structure |= setting;
|
|
|
|
else
|
|
|
|
*structure &= ~setting;
|
BPython:
- Scripts:
fixed error in "Save Current Theme" which prevented it from automatically updating script registration in menus.
cosmetic changes in a couple of Campbell's sel_same.py script strings + more descriptive name for its new menu place (3d view, face mode -> select menu).
small updates to help_browser.py script.
The above changes are related to this:
- Added new script menu entries: Render (for exporters to renderers), Themes, FaceSelect (this already at the proper place). Updated Scripts win->Scripts menu so it won't show all available entries, only the ones we mean to see there.
- Updated menu registration so that scripts folders can become trees. The release/scripts/ dir should be updated soon with subdirs like converters/, modifiers/, generators/ or whatever -- better discuss first (or is it? /me afraid of long irc discussions during meetings :) ).
- Modules:
Blender: added 'udatadir' option to .Get() function and added var Blender.mode to tell if Blender is in bg or interactive mode.
NMesh: added Campbell's nmesh.transform(matrix, recalc_normals = False) method (reworked, so my fault if it doesn't work).
- Bugs fixed:
#2123: http://projects.blender.org/tracker/?func=detail&atid=125&aid=2123&group_id=9
Reported by Ken Hughes (thanks!), who also found the exact problem later (it was in Text.Load, not with script links -- if only I had checked emails these days ... lost > 1 hour today to find the problem: passed filename to M_Text_Load was later being written over by a function called by add_text). Also saw that Text.Load wasn't checking existence of passed filename (duh!), now it does.
#1655: http://projects.blender.org/tracker/?func=detail&atid=125&aid=1655&group_id=9
Reported by Chris Want (thanks!): command line "blender -P script" not working properly for bg mode ("blender -b blendfile -P script").
Had to make some small updates to get it working (bg mode for scripts was never explicitely handled, it worked due to collateral effects, let's say), interested readers can check the report after I update it or the API_intro.py doc file. After more testing we can make further updates. Updated many places to not call redraws if in bg mode, now it is officially available. Blender outputs its own info when rendering in bg mode, if that is considered a nuissance we'll have to add a few "if (during_script())" calls outside bpython.
- Removed a few warnings here and there and also updated docs.
2005-03-19 06:24:55 +00:00
|
|
|
EXPP_allqueue( REDRAWBUTSSCENE, 0 );
|
2004-03-14 02:06:57 +00:00
|
|
|
|
2004-09-25 20:30:40 +00:00
|
|
|
return EXPP_incr_ret( Py_None );
|
2004-03-14 02:06:57 +00:00
|
|
|
|
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------BitToggleShort---------------------
|
|
|
|
static PyObject *M_Render_BitToggleShort( PyObject * args, short setting,
|
|
|
|
short *structure )
|
2004-03-14 02:06:57 +00:00
|
|
|
{
|
|
|
|
int flag;
|
|
|
|
|
2004-09-25 20:30:40 +00:00
|
|
|
if( !PyArg_ParseTuple( args, "i", &flag ) )
|
|
|
|
return ( EXPP_ReturnPyObjError
|
|
|
|
( PyExc_AttributeError,
|
|
|
|
"expected TRUE or FALSE (1 or 0)" ) );
|
2004-03-14 02:06:57 +00:00
|
|
|
|
2004-09-25 20:30:40 +00:00
|
|
|
if( flag < 0 || flag > 1 )
|
|
|
|
return ( EXPP_ReturnPyObjError
|
|
|
|
( PyExc_AttributeError,
|
|
|
|
"expected TRUE or FALSE (1 or 0)" ) );
|
2004-03-14 02:06:57 +00:00
|
|
|
|
2004-09-25 20:30:40 +00:00
|
|
|
if( flag )
|
2004-03-14 02:06:57 +00:00
|
|
|
*structure |= setting;
|
|
|
|
else
|
|
|
|
*structure &= ~setting;
|
BPython:
- Scripts:
fixed error in "Save Current Theme" which prevented it from automatically updating script registration in menus.
cosmetic changes in a couple of Campbell's sel_same.py script strings + more descriptive name for its new menu place (3d view, face mode -> select menu).
small updates to help_browser.py script.
The above changes are related to this:
- Added new script menu entries: Render (for exporters to renderers), Themes, FaceSelect (this already at the proper place). Updated Scripts win->Scripts menu so it won't show all available entries, only the ones we mean to see there.
- Updated menu registration so that scripts folders can become trees. The release/scripts/ dir should be updated soon with subdirs like converters/, modifiers/, generators/ or whatever -- better discuss first (or is it? /me afraid of long irc discussions during meetings :) ).
- Modules:
Blender: added 'udatadir' option to .Get() function and added var Blender.mode to tell if Blender is in bg or interactive mode.
NMesh: added Campbell's nmesh.transform(matrix, recalc_normals = False) method (reworked, so my fault if it doesn't work).
- Bugs fixed:
#2123: http://projects.blender.org/tracker/?func=detail&atid=125&aid=2123&group_id=9
Reported by Ken Hughes (thanks!), who also found the exact problem later (it was in Text.Load, not with script links -- if only I had checked emails these days ... lost > 1 hour today to find the problem: passed filename to M_Text_Load was later being written over by a function called by add_text). Also saw that Text.Load wasn't checking existence of passed filename (duh!), now it does.
#1655: http://projects.blender.org/tracker/?func=detail&atid=125&aid=1655&group_id=9
Reported by Chris Want (thanks!): command line "blender -P script" not working properly for bg mode ("blender -b blendfile -P script").
Had to make some small updates to get it working (bg mode for scripts was never explicitely handled, it worked due to collateral effects, let's say), interested readers can check the report after I update it or the API_intro.py doc file. After more testing we can make further updates. Updated many places to not call redraws if in bg mode, now it is officially available. Blender outputs its own info when rendering in bg mode, if that is considered a nuissance we'll have to add a few "if (during_script())" calls outside bpython.
- Removed a few warnings here and there and also updated docs.
2005-03-19 06:24:55 +00:00
|
|
|
EXPP_allqueue( REDRAWBUTSSCENE, 0 );
|
2004-03-14 02:06:57 +00:00
|
|
|
|
2004-09-25 20:30:40 +00:00
|
|
|
return EXPP_incr_ret( Py_None );
|
2004-03-14 02:06:57 +00:00
|
|
|
|
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------GetSetAttributeFloat---------------
|
|
|
|
static PyObject *M_Render_GetSetAttributeFloat( PyObject * args,
|
|
|
|
float *structure, float min,
|
|
|
|
float max )
|
2004-03-14 02:06:57 +00:00
|
|
|
{
|
|
|
|
float property = -10.0f;
|
|
|
|
char error[48];
|
|
|
|
|
2004-09-25 20:30:40 +00:00
|
|
|
if( !PyArg_ParseTuple( args, "|f", &property ) )
|
|
|
|
return ( EXPP_ReturnPyObjError
|
|
|
|
( PyExc_AttributeError, "expected float" ) );
|
2004-03-14 02:06:57 +00:00
|
|
|
|
2004-09-25 20:30:40 +00:00
|
|
|
if( property != -10.0f ) {
|
|
|
|
if( property < min || property > max ) {
|
|
|
|
sprintf( error, "out of range - expected %f to %f",
|
|
|
|
min, max );
|
|
|
|
return ( EXPP_ReturnPyObjError
|
|
|
|
( PyExc_AttributeError, error ) );
|
2004-03-14 02:06:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
*structure = property;
|
BPython:
- Scripts:
fixed error in "Save Current Theme" which prevented it from automatically updating script registration in menus.
cosmetic changes in a couple of Campbell's sel_same.py script strings + more descriptive name for its new menu place (3d view, face mode -> select menu).
small updates to help_browser.py script.
The above changes are related to this:
- Added new script menu entries: Render (for exporters to renderers), Themes, FaceSelect (this already at the proper place). Updated Scripts win->Scripts menu so it won't show all available entries, only the ones we mean to see there.
- Updated menu registration so that scripts folders can become trees. The release/scripts/ dir should be updated soon with subdirs like converters/, modifiers/, generators/ or whatever -- better discuss first (or is it? /me afraid of long irc discussions during meetings :) ).
- Modules:
Blender: added 'udatadir' option to .Get() function and added var Blender.mode to tell if Blender is in bg or interactive mode.
NMesh: added Campbell's nmesh.transform(matrix, recalc_normals = False) method (reworked, so my fault if it doesn't work).
- Bugs fixed:
#2123: http://projects.blender.org/tracker/?func=detail&atid=125&aid=2123&group_id=9
Reported by Ken Hughes (thanks!), who also found the exact problem later (it was in Text.Load, not with script links -- if only I had checked emails these days ... lost > 1 hour today to find the problem: passed filename to M_Text_Load was later being written over by a function called by add_text). Also saw that Text.Load wasn't checking existence of passed filename (duh!), now it does.
#1655: http://projects.blender.org/tracker/?func=detail&atid=125&aid=1655&group_id=9
Reported by Chris Want (thanks!): command line "blender -P script" not working properly for bg mode ("blender -b blendfile -P script").
Had to make some small updates to get it working (bg mode for scripts was never explicitely handled, it worked due to collateral effects, let's say), interested readers can check the report after I update it or the API_intro.py doc file. After more testing we can make further updates. Updated many places to not call redraws if in bg mode, now it is officially available. Blender outputs its own info when rendering in bg mode, if that is considered a nuissance we'll have to add a few "if (during_script())" calls outside bpython.
- Removed a few warnings here and there and also updated docs.
2005-03-19 06:24:55 +00:00
|
|
|
EXPP_allqueue( REDRAWBUTSSCENE, 0 );
|
2004-09-25 20:30:40 +00:00
|
|
|
return EXPP_incr_ret( Py_None );
|
|
|
|
} else
|
|
|
|
return Py_BuildValue( "f", *structure );
|
2004-03-14 02:06:57 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------GetSetAttributeShort---------------
|
|
|
|
static PyObject *M_Render_GetSetAttributeShort( PyObject * args,
|
|
|
|
short *structure, int min,
|
|
|
|
int max )
|
2004-03-14 02:06:57 +00:00
|
|
|
{
|
|
|
|
short property = -10;
|
|
|
|
char error[48];
|
|
|
|
|
2004-09-25 20:30:40 +00:00
|
|
|
if( !PyArg_ParseTuple( args, "|h", &property ) )
|
|
|
|
return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
|
|
|
|
"expected int" ) );
|
2004-03-14 02:06:57 +00:00
|
|
|
|
2004-09-25 20:30:40 +00:00
|
|
|
if( property != -10 ) {
|
|
|
|
if( property < min || property > max ) {
|
|
|
|
sprintf( error, "out of range - expected %d to %d",
|
|
|
|
min, max );
|
|
|
|
return ( EXPP_ReturnPyObjError
|
|
|
|
( PyExc_AttributeError, error ) );
|
2004-03-14 02:06:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
*structure = property;
|
BPython:
- Scripts:
fixed error in "Save Current Theme" which prevented it from automatically updating script registration in menus.
cosmetic changes in a couple of Campbell's sel_same.py script strings + more descriptive name for its new menu place (3d view, face mode -> select menu).
small updates to help_browser.py script.
The above changes are related to this:
- Added new script menu entries: Render (for exporters to renderers), Themes, FaceSelect (this already at the proper place). Updated Scripts win->Scripts menu so it won't show all available entries, only the ones we mean to see there.
- Updated menu registration so that scripts folders can become trees. The release/scripts/ dir should be updated soon with subdirs like converters/, modifiers/, generators/ or whatever -- better discuss first (or is it? /me afraid of long irc discussions during meetings :) ).
- Modules:
Blender: added 'udatadir' option to .Get() function and added var Blender.mode to tell if Blender is in bg or interactive mode.
NMesh: added Campbell's nmesh.transform(matrix, recalc_normals = False) method (reworked, so my fault if it doesn't work).
- Bugs fixed:
#2123: http://projects.blender.org/tracker/?func=detail&atid=125&aid=2123&group_id=9
Reported by Ken Hughes (thanks!), who also found the exact problem later (it was in Text.Load, not with script links -- if only I had checked emails these days ... lost > 1 hour today to find the problem: passed filename to M_Text_Load was later being written over by a function called by add_text). Also saw that Text.Load wasn't checking existence of passed filename (duh!), now it does.
#1655: http://projects.blender.org/tracker/?func=detail&atid=125&aid=1655&group_id=9
Reported by Chris Want (thanks!): command line "blender -P script" not working properly for bg mode ("blender -b blendfile -P script").
Had to make some small updates to get it working (bg mode for scripts was never explicitely handled, it worked due to collateral effects, let's say), interested readers can check the report after I update it or the API_intro.py doc file. After more testing we can make further updates. Updated many places to not call redraws if in bg mode, now it is officially available. Blender outputs its own info when rendering in bg mode, if that is considered a nuissance we'll have to add a few "if (during_script())" calls outside bpython.
- Removed a few warnings here and there and also updated docs.
2005-03-19 06:24:55 +00:00
|
|
|
EXPP_allqueue( REDRAWBUTSSCENE, 0 );
|
2004-09-25 20:30:40 +00:00
|
|
|
return EXPP_incr_ret( Py_None );
|
|
|
|
} else
|
|
|
|
return Py_BuildValue( "h", *structure );
|
2004-03-14 02:06:57 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------GetSetAttributeInt-----------------
|
|
|
|
static PyObject *M_Render_GetSetAttributeInt( PyObject * args, int *structure,
|
|
|
|
int min, int max )
|
2004-03-14 02:06:57 +00:00
|
|
|
{
|
|
|
|
int property = -10;
|
|
|
|
char error[48];
|
|
|
|
|
2004-09-25 20:30:40 +00:00
|
|
|
if( !PyArg_ParseTuple( args, "|i", &property ) )
|
|
|
|
return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
|
|
|
|
"expected int" ) );
|
2004-03-14 02:06:57 +00:00
|
|
|
|
2004-09-25 20:30:40 +00:00
|
|
|
if( property != -10 ) {
|
|
|
|
if( property < min || property > max ) {
|
|
|
|
sprintf( error, "out of range - expected %d to %d",
|
|
|
|
min, max );
|
|
|
|
return ( EXPP_ReturnPyObjError
|
|
|
|
( PyExc_AttributeError, error ) );
|
2004-03-14 02:06:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
*structure = property;
|
BPython:
- Scripts:
fixed error in "Save Current Theme" which prevented it from automatically updating script registration in menus.
cosmetic changes in a couple of Campbell's sel_same.py script strings + more descriptive name for its new menu place (3d view, face mode -> select menu).
small updates to help_browser.py script.
The above changes are related to this:
- Added new script menu entries: Render (for exporters to renderers), Themes, FaceSelect (this already at the proper place). Updated Scripts win->Scripts menu so it won't show all available entries, only the ones we mean to see there.
- Updated menu registration so that scripts folders can become trees. The release/scripts/ dir should be updated soon with subdirs like converters/, modifiers/, generators/ or whatever -- better discuss first (or is it? /me afraid of long irc discussions during meetings :) ).
- Modules:
Blender: added 'udatadir' option to .Get() function and added var Blender.mode to tell if Blender is in bg or interactive mode.
NMesh: added Campbell's nmesh.transform(matrix, recalc_normals = False) method (reworked, so my fault if it doesn't work).
- Bugs fixed:
#2123: http://projects.blender.org/tracker/?func=detail&atid=125&aid=2123&group_id=9
Reported by Ken Hughes (thanks!), who also found the exact problem later (it was in Text.Load, not with script links -- if only I had checked emails these days ... lost > 1 hour today to find the problem: passed filename to M_Text_Load was later being written over by a function called by add_text). Also saw that Text.Load wasn't checking existence of passed filename (duh!), now it does.
#1655: http://projects.blender.org/tracker/?func=detail&atid=125&aid=1655&group_id=9
Reported by Chris Want (thanks!): command line "blender -P script" not working properly for bg mode ("blender -b blendfile -P script").
Had to make some small updates to get it working (bg mode for scripts was never explicitely handled, it worked due to collateral effects, let's say), interested readers can check the report after I update it or the API_intro.py doc file. After more testing we can make further updates. Updated many places to not call redraws if in bg mode, now it is officially available. Blender outputs its own info when rendering in bg mode, if that is considered a nuissance we'll have to add a few "if (during_script())" calls outside bpython.
- Removed a few warnings here and there and also updated docs.
2005-03-19 06:24:55 +00:00
|
|
|
EXPP_allqueue( REDRAWBUTSSCENE, 0 );
|
2004-09-25 20:30:40 +00:00
|
|
|
return EXPP_incr_ret( Py_None );
|
|
|
|
} else
|
|
|
|
return Py_BuildValue( "i", *structure );
|
|
|
|
}
|
|
|
|
|
|
|
|
//------------------------------------DoSizePrese -----------------------
|
|
|
|
static void M_Render_DoSizePreset( BPy_RenderData * self, short xsch,
|
|
|
|
short ysch, short xasp, short yasp,
|
|
|
|
short size, short xparts, short yparts,
|
|
|
|
short frames, float a, float b, float c,
|
|
|
|
float d )
|
|
|
|
{
|
|
|
|
self->renderContext->xsch = xsch;
|
|
|
|
self->renderContext->ysch = ysch;
|
|
|
|
self->renderContext->xasp = xasp;
|
|
|
|
self->renderContext->yasp = yasp;
|
|
|
|
self->renderContext->size = size;
|
|
|
|
self->renderContext->frs_sec = frames;
|
|
|
|
self->renderContext->xparts = xparts;
|
|
|
|
self->renderContext->yparts = yparts;
|
|
|
|
|
|
|
|
BLI_init_rctf( &self->renderContext->safety, a, b, c, d );
|
BPython:
- Scripts:
fixed error in "Save Current Theme" which prevented it from automatically updating script registration in menus.
cosmetic changes in a couple of Campbell's sel_same.py script strings + more descriptive name for its new menu place (3d view, face mode -> select menu).
small updates to help_browser.py script.
The above changes are related to this:
- Added new script menu entries: Render (for exporters to renderers), Themes, FaceSelect (this already at the proper place). Updated Scripts win->Scripts menu so it won't show all available entries, only the ones we mean to see there.
- Updated menu registration so that scripts folders can become trees. The release/scripts/ dir should be updated soon with subdirs like converters/, modifiers/, generators/ or whatever -- better discuss first (or is it? /me afraid of long irc discussions during meetings :) ).
- Modules:
Blender: added 'udatadir' option to .Get() function and added var Blender.mode to tell if Blender is in bg or interactive mode.
NMesh: added Campbell's nmesh.transform(matrix, recalc_normals = False) method (reworked, so my fault if it doesn't work).
- Bugs fixed:
#2123: http://projects.blender.org/tracker/?func=detail&atid=125&aid=2123&group_id=9
Reported by Ken Hughes (thanks!), who also found the exact problem later (it was in Text.Load, not with script links -- if only I had checked emails these days ... lost > 1 hour today to find the problem: passed filename to M_Text_Load was later being written over by a function called by add_text). Also saw that Text.Load wasn't checking existence of passed filename (duh!), now it does.
#1655: http://projects.blender.org/tracker/?func=detail&atid=125&aid=1655&group_id=9
Reported by Chris Want (thanks!): command line "blender -P script" not working properly for bg mode ("blender -b blendfile -P script").
Had to make some small updates to get it working (bg mode for scripts was never explicitely handled, it worked due to collateral effects, let's say), interested readers can check the report after I update it or the API_intro.py doc file. After more testing we can make further updates. Updated many places to not call redraws if in bg mode, now it is officially available. Blender outputs its own info when rendering in bg mode, if that is considered a nuissance we'll have to add a few "if (during_script())" calls outside bpython.
- Removed a few warnings here and there and also updated docs.
2005-03-19 06:24:55 +00:00
|
|
|
EXPP_allqueue( REDRAWBUTSSCENE, 0 );
|
|
|
|
EXPP_allqueue( REDRAWVIEWCAM, 0 );
|
2004-09-25 20:30:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//------------------------------------Render Module Function Definitions-
|
|
|
|
//------------------------------------Render.CloseRenderWindow() --------
|
|
|
|
PyObject *M_Render_CloseRenderWindow( PyObject * self )
|
|
|
|
{
|
|
|
|
BIF_close_render_display( );
|
|
|
|
return EXPP_incr_ret( Py_None );
|
|
|
|
}
|
|
|
|
|
|
|
|
//------------------------------------Render.SetRenderWinPos() ----------
|
|
|
|
PyObject *M_Render_SetRenderWinPos( PyObject * self, PyObject * args )
|
2004-03-14 02:06:57 +00:00
|
|
|
{
|
|
|
|
PyObject *list = NULL;
|
|
|
|
char *loc = NULL;
|
|
|
|
int x;
|
|
|
|
|
2004-09-25 20:30:40 +00:00
|
|
|
if( !PyArg_ParseTuple( args, "O!", &PyList_Type, &list ) )
|
|
|
|
return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
|
|
|
|
"expected a list" ) );
|
2004-03-14 02:06:57 +00:00
|
|
|
|
Biiig commit! Thanks to 2-3 weeks of cvs freeze...
Render:
- New; support for dual CPU render (SDL thread)
Currently only works with alternating scanlines, but gives excellent
performance. For both normal render as unified implemented.
Note the "mutex" locks on z-transp buffer render and imbuf loads.
- This has been made possible by major cleanups in render code, especially
getting rid of globals (example Tin Tr Tg Tb Ta for textures) or struct
OSA or using Materials or Texture data to write to.
- Made normal render fully 4x32 floats too, and removed all old optimizes
with chars or shorts.
- Made normal render and unified render use same code for sky and halo
render, giving equal (and better) results for halo render. Old render
now also uses PostProcess options (brightness, mul, gamma)
- Added option ("FBuf") in F10 Output Panel, this keeps a 4x32 bits buffer
after render. Using PostProcess menu you will note an immediate re-
display of image too (32 bits RGBA)
- Added "Hue" and "Saturation" sliders to PostProcess options
- Render module is still not having a "nice" API, but amount of dependencies
went down a lot. Next todo: remove abusive "previewrender" code.
The last main global in Render (struct Render) now can be re-used for fully
controlling a render, to allow multiple "instances" of render to open.
- Renderwindow now displays a smal bar on top with the stats, and keeps the
stats after render too. Including "spare" page support.
Not only easier visible that way, but also to remove the awkward code that
was drawing stats in the Info header (extreme slow on some ATIs too)
- Cleaned up blendef.h and BKE_utildefines.h, these two had overlapping
defines.
- I might have forgotten stuff... and will write a nice doc on the architecture!
2004-12-27 19:28:52 +00:00
|
|
|
G.winpos = 0;
|
2004-09-25 20:30:40 +00:00
|
|
|
for( x = 0; x < PyList_Size( list ); x++ ) {
|
|
|
|
if( !PyArg_Parse( PyList_GetItem( list, x ), "s", &loc ) ) {
|
|
|
|
return EXPP_ReturnPyObjError( PyExc_TypeError,
|
|
|
|
"python list not parseable\n" );
|
|
|
|
}
|
|
|
|
if( strcmp( loc, "SW" ) == 0 || strcmp( loc, "sw" ) == 0 )
|
Biiig commit! Thanks to 2-3 weeks of cvs freeze...
Render:
- New; support for dual CPU render (SDL thread)
Currently only works with alternating scanlines, but gives excellent
performance. For both normal render as unified implemented.
Note the "mutex" locks on z-transp buffer render and imbuf loads.
- This has been made possible by major cleanups in render code, especially
getting rid of globals (example Tin Tr Tg Tb Ta for textures) or struct
OSA or using Materials or Texture data to write to.
- Made normal render fully 4x32 floats too, and removed all old optimizes
with chars or shorts.
- Made normal render and unified render use same code for sky and halo
render, giving equal (and better) results for halo render. Old render
now also uses PostProcess options (brightness, mul, gamma)
- Added option ("FBuf") in F10 Output Panel, this keeps a 4x32 bits buffer
after render. Using PostProcess menu you will note an immediate re-
display of image too (32 bits RGBA)
- Added "Hue" and "Saturation" sliders to PostProcess options
- Render module is still not having a "nice" API, but amount of dependencies
went down a lot. Next todo: remove abusive "previewrender" code.
The last main global in Render (struct Render) now can be re-used for fully
controlling a render, to allow multiple "instances" of render to open.
- Renderwindow now displays a smal bar on top with the stats, and keeps the
stats after render too. Including "spare" page support.
Not only easier visible that way, but also to remove the awkward code that
was drawing stats in the Info header (extreme slow on some ATIs too)
- Cleaned up blendef.h and BKE_utildefines.h, these two had overlapping
defines.
- I might have forgotten stuff... and will write a nice doc on the architecture!
2004-12-27 19:28:52 +00:00
|
|
|
G.winpos |= 1;
|
2004-09-25 20:30:40 +00:00
|
|
|
else if( strcmp( loc, "S" ) == 0 || strcmp( loc, "s" ) == 0 )
|
Biiig commit! Thanks to 2-3 weeks of cvs freeze...
Render:
- New; support for dual CPU render (SDL thread)
Currently only works with alternating scanlines, but gives excellent
performance. For both normal render as unified implemented.
Note the "mutex" locks on z-transp buffer render and imbuf loads.
- This has been made possible by major cleanups in render code, especially
getting rid of globals (example Tin Tr Tg Tb Ta for textures) or struct
OSA or using Materials or Texture data to write to.
- Made normal render fully 4x32 floats too, and removed all old optimizes
with chars or shorts.
- Made normal render and unified render use same code for sky and halo
render, giving equal (and better) results for halo render. Old render
now also uses PostProcess options (brightness, mul, gamma)
- Added option ("FBuf") in F10 Output Panel, this keeps a 4x32 bits buffer
after render. Using PostProcess menu you will note an immediate re-
display of image too (32 bits RGBA)
- Added "Hue" and "Saturation" sliders to PostProcess options
- Render module is still not having a "nice" API, but amount of dependencies
went down a lot. Next todo: remove abusive "previewrender" code.
The last main global in Render (struct Render) now can be re-used for fully
controlling a render, to allow multiple "instances" of render to open.
- Renderwindow now displays a smal bar on top with the stats, and keeps the
stats after render too. Including "spare" page support.
Not only easier visible that way, but also to remove the awkward code that
was drawing stats in the Info header (extreme slow on some ATIs too)
- Cleaned up blendef.h and BKE_utildefines.h, these two had overlapping
defines.
- I might have forgotten stuff... and will write a nice doc on the architecture!
2004-12-27 19:28:52 +00:00
|
|
|
G.winpos |= 2;
|
2004-09-25 20:30:40 +00:00
|
|
|
else if( strcmp( loc, "SE" ) == 0 || strcmp( loc, "se" ) == 0 )
|
Biiig commit! Thanks to 2-3 weeks of cvs freeze...
Render:
- New; support for dual CPU render (SDL thread)
Currently only works with alternating scanlines, but gives excellent
performance. For both normal render as unified implemented.
Note the "mutex" locks on z-transp buffer render and imbuf loads.
- This has been made possible by major cleanups in render code, especially
getting rid of globals (example Tin Tr Tg Tb Ta for textures) or struct
OSA or using Materials or Texture data to write to.
- Made normal render fully 4x32 floats too, and removed all old optimizes
with chars or shorts.
- Made normal render and unified render use same code for sky and halo
render, giving equal (and better) results for halo render. Old render
now also uses PostProcess options (brightness, mul, gamma)
- Added option ("FBuf") in F10 Output Panel, this keeps a 4x32 bits buffer
after render. Using PostProcess menu you will note an immediate re-
display of image too (32 bits RGBA)
- Added "Hue" and "Saturation" sliders to PostProcess options
- Render module is still not having a "nice" API, but amount of dependencies
went down a lot. Next todo: remove abusive "previewrender" code.
The last main global in Render (struct Render) now can be re-used for fully
controlling a render, to allow multiple "instances" of render to open.
- Renderwindow now displays a smal bar on top with the stats, and keeps the
stats after render too. Including "spare" page support.
Not only easier visible that way, but also to remove the awkward code that
was drawing stats in the Info header (extreme slow on some ATIs too)
- Cleaned up blendef.h and BKE_utildefines.h, these two had overlapping
defines.
- I might have forgotten stuff... and will write a nice doc on the architecture!
2004-12-27 19:28:52 +00:00
|
|
|
G.winpos |= 4;
|
2004-09-25 20:30:40 +00:00
|
|
|
else if( strcmp( loc, "W" ) == 0 || strcmp( loc, "w" ) == 0 )
|
Biiig commit! Thanks to 2-3 weeks of cvs freeze...
Render:
- New; support for dual CPU render (SDL thread)
Currently only works with alternating scanlines, but gives excellent
performance. For both normal render as unified implemented.
Note the "mutex" locks on z-transp buffer render and imbuf loads.
- This has been made possible by major cleanups in render code, especially
getting rid of globals (example Tin Tr Tg Tb Ta for textures) or struct
OSA or using Materials or Texture data to write to.
- Made normal render fully 4x32 floats too, and removed all old optimizes
with chars or shorts.
- Made normal render and unified render use same code for sky and halo
render, giving equal (and better) results for halo render. Old render
now also uses PostProcess options (brightness, mul, gamma)
- Added option ("FBuf") in F10 Output Panel, this keeps a 4x32 bits buffer
after render. Using PostProcess menu you will note an immediate re-
display of image too (32 bits RGBA)
- Added "Hue" and "Saturation" sliders to PostProcess options
- Render module is still not having a "nice" API, but amount of dependencies
went down a lot. Next todo: remove abusive "previewrender" code.
The last main global in Render (struct Render) now can be re-used for fully
controlling a render, to allow multiple "instances" of render to open.
- Renderwindow now displays a smal bar on top with the stats, and keeps the
stats after render too. Including "spare" page support.
Not only easier visible that way, but also to remove the awkward code that
was drawing stats in the Info header (extreme slow on some ATIs too)
- Cleaned up blendef.h and BKE_utildefines.h, these two had overlapping
defines.
- I might have forgotten stuff... and will write a nice doc on the architecture!
2004-12-27 19:28:52 +00:00
|
|
|
G.winpos |= 8;
|
2004-09-25 20:30:40 +00:00
|
|
|
else if( strcmp( loc, "C" ) == 0 || strcmp( loc, "c" ) == 0 )
|
Biiig commit! Thanks to 2-3 weeks of cvs freeze...
Render:
- New; support for dual CPU render (SDL thread)
Currently only works with alternating scanlines, but gives excellent
performance. For both normal render as unified implemented.
Note the "mutex" locks on z-transp buffer render and imbuf loads.
- This has been made possible by major cleanups in render code, especially
getting rid of globals (example Tin Tr Tg Tb Ta for textures) or struct
OSA or using Materials or Texture data to write to.
- Made normal render fully 4x32 floats too, and removed all old optimizes
with chars or shorts.
- Made normal render and unified render use same code for sky and halo
render, giving equal (and better) results for halo render. Old render
now also uses PostProcess options (brightness, mul, gamma)
- Added option ("FBuf") in F10 Output Panel, this keeps a 4x32 bits buffer
after render. Using PostProcess menu you will note an immediate re-
display of image too (32 bits RGBA)
- Added "Hue" and "Saturation" sliders to PostProcess options
- Render module is still not having a "nice" API, but amount of dependencies
went down a lot. Next todo: remove abusive "previewrender" code.
The last main global in Render (struct Render) now can be re-used for fully
controlling a render, to allow multiple "instances" of render to open.
- Renderwindow now displays a smal bar on top with the stats, and keeps the
stats after render too. Including "spare" page support.
Not only easier visible that way, but also to remove the awkward code that
was drawing stats in the Info header (extreme slow on some ATIs too)
- Cleaned up blendef.h and BKE_utildefines.h, these two had overlapping
defines.
- I might have forgotten stuff... and will write a nice doc on the architecture!
2004-12-27 19:28:52 +00:00
|
|
|
G.winpos |= 16;
|
2004-09-25 20:30:40 +00:00
|
|
|
else if( strcmp( loc, "E" ) == 0 || strcmp( loc, "e" ) == 0 )
|
Biiig commit! Thanks to 2-3 weeks of cvs freeze...
Render:
- New; support for dual CPU render (SDL thread)
Currently only works with alternating scanlines, but gives excellent
performance. For both normal render as unified implemented.
Note the "mutex" locks on z-transp buffer render and imbuf loads.
- This has been made possible by major cleanups in render code, especially
getting rid of globals (example Tin Tr Tg Tb Ta for textures) or struct
OSA or using Materials or Texture data to write to.
- Made normal render fully 4x32 floats too, and removed all old optimizes
with chars or shorts.
- Made normal render and unified render use same code for sky and halo
render, giving equal (and better) results for halo render. Old render
now also uses PostProcess options (brightness, mul, gamma)
- Added option ("FBuf") in F10 Output Panel, this keeps a 4x32 bits buffer
after render. Using PostProcess menu you will note an immediate re-
display of image too (32 bits RGBA)
- Added "Hue" and "Saturation" sliders to PostProcess options
- Render module is still not having a "nice" API, but amount of dependencies
went down a lot. Next todo: remove abusive "previewrender" code.
The last main global in Render (struct Render) now can be re-used for fully
controlling a render, to allow multiple "instances" of render to open.
- Renderwindow now displays a smal bar on top with the stats, and keeps the
stats after render too. Including "spare" page support.
Not only easier visible that way, but also to remove the awkward code that
was drawing stats in the Info header (extreme slow on some ATIs too)
- Cleaned up blendef.h and BKE_utildefines.h, these two had overlapping
defines.
- I might have forgotten stuff... and will write a nice doc on the architecture!
2004-12-27 19:28:52 +00:00
|
|
|
G.winpos |= 32;
|
2004-09-25 20:30:40 +00:00
|
|
|
else if( strcmp( loc, "NW" ) == 0 || strcmp( loc, "nw" ) == 0 )
|
Biiig commit! Thanks to 2-3 weeks of cvs freeze...
Render:
- New; support for dual CPU render (SDL thread)
Currently only works with alternating scanlines, but gives excellent
performance. For both normal render as unified implemented.
Note the "mutex" locks on z-transp buffer render and imbuf loads.
- This has been made possible by major cleanups in render code, especially
getting rid of globals (example Tin Tr Tg Tb Ta for textures) or struct
OSA or using Materials or Texture data to write to.
- Made normal render fully 4x32 floats too, and removed all old optimizes
with chars or shorts.
- Made normal render and unified render use same code for sky and halo
render, giving equal (and better) results for halo render. Old render
now also uses PostProcess options (brightness, mul, gamma)
- Added option ("FBuf") in F10 Output Panel, this keeps a 4x32 bits buffer
after render. Using PostProcess menu you will note an immediate re-
display of image too (32 bits RGBA)
- Added "Hue" and "Saturation" sliders to PostProcess options
- Render module is still not having a "nice" API, but amount of dependencies
went down a lot. Next todo: remove abusive "previewrender" code.
The last main global in Render (struct Render) now can be re-used for fully
controlling a render, to allow multiple "instances" of render to open.
- Renderwindow now displays a smal bar on top with the stats, and keeps the
stats after render too. Including "spare" page support.
Not only easier visible that way, but also to remove the awkward code that
was drawing stats in the Info header (extreme slow on some ATIs too)
- Cleaned up blendef.h and BKE_utildefines.h, these two had overlapping
defines.
- I might have forgotten stuff... and will write a nice doc on the architecture!
2004-12-27 19:28:52 +00:00
|
|
|
G.winpos |= 64;
|
2004-09-25 20:30:40 +00:00
|
|
|
else if( strcmp( loc, "N" ) == 0 || strcmp( loc, "n" ) == 0 )
|
Biiig commit! Thanks to 2-3 weeks of cvs freeze...
Render:
- New; support for dual CPU render (SDL thread)
Currently only works with alternating scanlines, but gives excellent
performance. For both normal render as unified implemented.
Note the "mutex" locks on z-transp buffer render and imbuf loads.
- This has been made possible by major cleanups in render code, especially
getting rid of globals (example Tin Tr Tg Tb Ta for textures) or struct
OSA or using Materials or Texture data to write to.
- Made normal render fully 4x32 floats too, and removed all old optimizes
with chars or shorts.
- Made normal render and unified render use same code for sky and halo
render, giving equal (and better) results for halo render. Old render
now also uses PostProcess options (brightness, mul, gamma)
- Added option ("FBuf") in F10 Output Panel, this keeps a 4x32 bits buffer
after render. Using PostProcess menu you will note an immediate re-
display of image too (32 bits RGBA)
- Added "Hue" and "Saturation" sliders to PostProcess options
- Render module is still not having a "nice" API, but amount of dependencies
went down a lot. Next todo: remove abusive "previewrender" code.
The last main global in Render (struct Render) now can be re-used for fully
controlling a render, to allow multiple "instances" of render to open.
- Renderwindow now displays a smal bar on top with the stats, and keeps the
stats after render too. Including "spare" page support.
Not only easier visible that way, but also to remove the awkward code that
was drawing stats in the Info header (extreme slow on some ATIs too)
- Cleaned up blendef.h and BKE_utildefines.h, these two had overlapping
defines.
- I might have forgotten stuff... and will write a nice doc on the architecture!
2004-12-27 19:28:52 +00:00
|
|
|
G.winpos |= 128;
|
2004-09-25 20:30:40 +00:00
|
|
|
else if( strcmp( loc, "NE" ) == 0 || strcmp( loc, "ne" ) == 0 )
|
Biiig commit! Thanks to 2-3 weeks of cvs freeze...
Render:
- New; support for dual CPU render (SDL thread)
Currently only works with alternating scanlines, but gives excellent
performance. For both normal render as unified implemented.
Note the "mutex" locks on z-transp buffer render and imbuf loads.
- This has been made possible by major cleanups in render code, especially
getting rid of globals (example Tin Tr Tg Tb Ta for textures) or struct
OSA or using Materials or Texture data to write to.
- Made normal render fully 4x32 floats too, and removed all old optimizes
with chars or shorts.
- Made normal render and unified render use same code for sky and halo
render, giving equal (and better) results for halo render. Old render
now also uses PostProcess options (brightness, mul, gamma)
- Added option ("FBuf") in F10 Output Panel, this keeps a 4x32 bits buffer
after render. Using PostProcess menu you will note an immediate re-
display of image too (32 bits RGBA)
- Added "Hue" and "Saturation" sliders to PostProcess options
- Render module is still not having a "nice" API, but amount of dependencies
went down a lot. Next todo: remove abusive "previewrender" code.
The last main global in Render (struct Render) now can be re-used for fully
controlling a render, to allow multiple "instances" of render to open.
- Renderwindow now displays a smal bar on top with the stats, and keeps the
stats after render too. Including "spare" page support.
Not only easier visible that way, but also to remove the awkward code that
was drawing stats in the Info header (extreme slow on some ATIs too)
- Cleaned up blendef.h and BKE_utildefines.h, these two had overlapping
defines.
- I might have forgotten stuff... and will write a nice doc on the architecture!
2004-12-27 19:28:52 +00:00
|
|
|
G.winpos |= 256;
|
2004-03-14 02:06:57 +00:00
|
|
|
else
|
2004-09-25 20:30:40 +00:00
|
|
|
return EXPP_ReturnPyObjError( PyExc_AttributeError,
|
|
|
|
"list contains unknown string\n" );
|
2004-03-14 02:06:57 +00:00
|
|
|
}
|
BPython:
- Scripts:
fixed error in "Save Current Theme" which prevented it from automatically updating script registration in menus.
cosmetic changes in a couple of Campbell's sel_same.py script strings + more descriptive name for its new menu place (3d view, face mode -> select menu).
small updates to help_browser.py script.
The above changes are related to this:
- Added new script menu entries: Render (for exporters to renderers), Themes, FaceSelect (this already at the proper place). Updated Scripts win->Scripts menu so it won't show all available entries, only the ones we mean to see there.
- Updated menu registration so that scripts folders can become trees. The release/scripts/ dir should be updated soon with subdirs like converters/, modifiers/, generators/ or whatever -- better discuss first (or is it? /me afraid of long irc discussions during meetings :) ).
- Modules:
Blender: added 'udatadir' option to .Get() function and added var Blender.mode to tell if Blender is in bg or interactive mode.
NMesh: added Campbell's nmesh.transform(matrix, recalc_normals = False) method (reworked, so my fault if it doesn't work).
- Bugs fixed:
#2123: http://projects.blender.org/tracker/?func=detail&atid=125&aid=2123&group_id=9
Reported by Ken Hughes (thanks!), who also found the exact problem later (it was in Text.Load, not with script links -- if only I had checked emails these days ... lost > 1 hour today to find the problem: passed filename to M_Text_Load was later being written over by a function called by add_text). Also saw that Text.Load wasn't checking existence of passed filename (duh!), now it does.
#1655: http://projects.blender.org/tracker/?func=detail&atid=125&aid=1655&group_id=9
Reported by Chris Want (thanks!): command line "blender -P script" not working properly for bg mode ("blender -b blendfile -P script").
Had to make some small updates to get it working (bg mode for scripts was never explicitely handled, it worked due to collateral effects, let's say), interested readers can check the report after I update it or the API_intro.py doc file. After more testing we can make further updates. Updated many places to not call redraws if in bg mode, now it is officially available. Blender outputs its own info when rendering in bg mode, if that is considered a nuissance we'll have to add a few "if (during_script())" calls outside bpython.
- Removed a few warnings here and there and also updated docs.
2005-03-19 06:24:55 +00:00
|
|
|
EXPP_allqueue( REDRAWBUTSSCENE, 0 );
|
2004-03-14 02:06:57 +00:00
|
|
|
|
2004-09-25 20:30:40 +00:00
|
|
|
return EXPP_incr_ret( Py_None );
|
2004-03-14 02:06:57 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------Render.EnableDispView() -----------
|
|
|
|
PyObject *M_Render_EnableDispView( PyObject * self )
|
2004-03-14 02:06:57 +00:00
|
|
|
{
|
Biiig commit! Thanks to 2-3 weeks of cvs freeze...
Render:
- New; support for dual CPU render (SDL thread)
Currently only works with alternating scanlines, but gives excellent
performance. For both normal render as unified implemented.
Note the "mutex" locks on z-transp buffer render and imbuf loads.
- This has been made possible by major cleanups in render code, especially
getting rid of globals (example Tin Tr Tg Tb Ta for textures) or struct
OSA or using Materials or Texture data to write to.
- Made normal render fully 4x32 floats too, and removed all old optimizes
with chars or shorts.
- Made normal render and unified render use same code for sky and halo
render, giving equal (and better) results for halo render. Old render
now also uses PostProcess options (brightness, mul, gamma)
- Added option ("FBuf") in F10 Output Panel, this keeps a 4x32 bits buffer
after render. Using PostProcess menu you will note an immediate re-
display of image too (32 bits RGBA)
- Added "Hue" and "Saturation" sliders to PostProcess options
- Render module is still not having a "nice" API, but amount of dependencies
went down a lot. Next todo: remove abusive "previewrender" code.
The last main global in Render (struct Render) now can be re-used for fully
controlling a render, to allow multiple "instances" of render to open.
- Renderwindow now displays a smal bar on top with the stats, and keeps the
stats after render too. Including "spare" page support.
Not only easier visible that way, but also to remove the awkward code that
was drawing stats in the Info header (extreme slow on some ATIs too)
- Cleaned up blendef.h and BKE_utildefines.h, these two had overlapping
defines.
- I might have forgotten stuff... and will write a nice doc on the architecture!
2004-12-27 19:28:52 +00:00
|
|
|
G.displaymode = R_DISPLAYVIEW;
|
BPython:
- Scripts:
fixed error in "Save Current Theme" which prevented it from automatically updating script registration in menus.
cosmetic changes in a couple of Campbell's sel_same.py script strings + more descriptive name for its new menu place (3d view, face mode -> select menu).
small updates to help_browser.py script.
The above changes are related to this:
- Added new script menu entries: Render (for exporters to renderers), Themes, FaceSelect (this already at the proper place). Updated Scripts win->Scripts menu so it won't show all available entries, only the ones we mean to see there.
- Updated menu registration so that scripts folders can become trees. The release/scripts/ dir should be updated soon with subdirs like converters/, modifiers/, generators/ or whatever -- better discuss first (or is it? /me afraid of long irc discussions during meetings :) ).
- Modules:
Blender: added 'udatadir' option to .Get() function and added var Blender.mode to tell if Blender is in bg or interactive mode.
NMesh: added Campbell's nmesh.transform(matrix, recalc_normals = False) method (reworked, so my fault if it doesn't work).
- Bugs fixed:
#2123: http://projects.blender.org/tracker/?func=detail&atid=125&aid=2123&group_id=9
Reported by Ken Hughes (thanks!), who also found the exact problem later (it was in Text.Load, not with script links -- if only I had checked emails these days ... lost > 1 hour today to find the problem: passed filename to M_Text_Load was later being written over by a function called by add_text). Also saw that Text.Load wasn't checking existence of passed filename (duh!), now it does.
#1655: http://projects.blender.org/tracker/?func=detail&atid=125&aid=1655&group_id=9
Reported by Chris Want (thanks!): command line "blender -P script" not working properly for bg mode ("blender -b blendfile -P script").
Had to make some small updates to get it working (bg mode for scripts was never explicitely handled, it worked due to collateral effects, let's say), interested readers can check the report after I update it or the API_intro.py doc file. After more testing we can make further updates. Updated many places to not call redraws if in bg mode, now it is officially available. Blender outputs its own info when rendering in bg mode, if that is considered a nuissance we'll have to add a few "if (during_script())" calls outside bpython.
- Removed a few warnings here and there and also updated docs.
2005-03-19 06:24:55 +00:00
|
|
|
EXPP_allqueue( REDRAWBUTSSCENE, 0 );
|
2004-03-14 02:06:57 +00:00
|
|
|
|
2004-09-25 20:30:40 +00:00
|
|
|
return EXPP_incr_ret( Py_None );
|
2004-03-14 02:06:57 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------Render.EnableDispWin() ------------
|
|
|
|
PyObject *M_Render_EnableDispWin( PyObject * self )
|
2004-03-14 02:06:57 +00:00
|
|
|
{
|
Biiig commit! Thanks to 2-3 weeks of cvs freeze...
Render:
- New; support for dual CPU render (SDL thread)
Currently only works with alternating scanlines, but gives excellent
performance. For both normal render as unified implemented.
Note the "mutex" locks on z-transp buffer render and imbuf loads.
- This has been made possible by major cleanups in render code, especially
getting rid of globals (example Tin Tr Tg Tb Ta for textures) or struct
OSA or using Materials or Texture data to write to.
- Made normal render fully 4x32 floats too, and removed all old optimizes
with chars or shorts.
- Made normal render and unified render use same code for sky and halo
render, giving equal (and better) results for halo render. Old render
now also uses PostProcess options (brightness, mul, gamma)
- Added option ("FBuf") in F10 Output Panel, this keeps a 4x32 bits buffer
after render. Using PostProcess menu you will note an immediate re-
display of image too (32 bits RGBA)
- Added "Hue" and "Saturation" sliders to PostProcess options
- Render module is still not having a "nice" API, but amount of dependencies
went down a lot. Next todo: remove abusive "previewrender" code.
The last main global in Render (struct Render) now can be re-used for fully
controlling a render, to allow multiple "instances" of render to open.
- Renderwindow now displays a smal bar on top with the stats, and keeps the
stats after render too. Including "spare" page support.
Not only easier visible that way, but also to remove the awkward code that
was drawing stats in the Info header (extreme slow on some ATIs too)
- Cleaned up blendef.h and BKE_utildefines.h, these two had overlapping
defines.
- I might have forgotten stuff... and will write a nice doc on the architecture!
2004-12-27 19:28:52 +00:00
|
|
|
G.displaymode = R_DISPLAYWIN;
|
BPython:
- Scripts:
fixed error in "Save Current Theme" which prevented it from automatically updating script registration in menus.
cosmetic changes in a couple of Campbell's sel_same.py script strings + more descriptive name for its new menu place (3d view, face mode -> select menu).
small updates to help_browser.py script.
The above changes are related to this:
- Added new script menu entries: Render (for exporters to renderers), Themes, FaceSelect (this already at the proper place). Updated Scripts win->Scripts menu so it won't show all available entries, only the ones we mean to see there.
- Updated menu registration so that scripts folders can become trees. The release/scripts/ dir should be updated soon with subdirs like converters/, modifiers/, generators/ or whatever -- better discuss first (or is it? /me afraid of long irc discussions during meetings :) ).
- Modules:
Blender: added 'udatadir' option to .Get() function and added var Blender.mode to tell if Blender is in bg or interactive mode.
NMesh: added Campbell's nmesh.transform(matrix, recalc_normals = False) method (reworked, so my fault if it doesn't work).
- Bugs fixed:
#2123: http://projects.blender.org/tracker/?func=detail&atid=125&aid=2123&group_id=9
Reported by Ken Hughes (thanks!), who also found the exact problem later (it was in Text.Load, not with script links -- if only I had checked emails these days ... lost > 1 hour today to find the problem: passed filename to M_Text_Load was later being written over by a function called by add_text). Also saw that Text.Load wasn't checking existence of passed filename (duh!), now it does.
#1655: http://projects.blender.org/tracker/?func=detail&atid=125&aid=1655&group_id=9
Reported by Chris Want (thanks!): command line "blender -P script" not working properly for bg mode ("blender -b blendfile -P script").
Had to make some small updates to get it working (bg mode for scripts was never explicitely handled, it worked due to collateral effects, let's say), interested readers can check the report after I update it or the API_intro.py doc file. After more testing we can make further updates. Updated many places to not call redraws if in bg mode, now it is officially available. Blender outputs its own info when rendering in bg mode, if that is considered a nuissance we'll have to add a few "if (during_script())" calls outside bpython.
- Removed a few warnings here and there and also updated docs.
2005-03-19 06:24:55 +00:00
|
|
|
EXPP_allqueue( REDRAWBUTSSCENE, 0 );
|
2004-03-14 02:06:57 +00:00
|
|
|
|
2004-09-25 20:30:40 +00:00
|
|
|
return EXPP_incr_ret( Py_None );
|
2004-03-14 02:06:57 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------Render.EnableEdgeShift() ----------
|
|
|
|
PyObject *M_Render_EnableEdgeShift( PyObject * self, PyObject * args )
|
2004-04-25 05:18:43 +00:00
|
|
|
{
|
2004-09-25 20:30:40 +00:00
|
|
|
return M_Render_BitToggleInt( args, 1, &G.compat );
|
2004-04-25 05:18:43 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------Render.EnableEdgeAll() ------------
|
|
|
|
PyObject *M_Render_EnableEdgeAll( PyObject * self, PyObject * args )
|
2004-04-25 05:18:43 +00:00
|
|
|
{
|
2004-09-25 20:30:40 +00:00
|
|
|
return M_Render_BitToggleInt( args, 1, &G.notonlysolid );
|
2004-04-25 05:18:43 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//----------------------------BPy_RenderData Function Definitions--------
|
|
|
|
|
|
|
|
//------------------------------------RenderData.Render() ---------------
|
|
|
|
PyObject *RenderData_Render( BPy_RenderData * self )
|
2004-04-25 05:18:43 +00:00
|
|
|
{
|
2004-09-25 20:30:40 +00:00
|
|
|
Scene *oldsce;
|
2004-04-25 05:18:43 +00:00
|
|
|
|
BPython:
- Scripts:
fixed error in "Save Current Theme" which prevented it from automatically updating script registration in menus.
cosmetic changes in a couple of Campbell's sel_same.py script strings + more descriptive name for its new menu place (3d view, face mode -> select menu).
small updates to help_browser.py script.
The above changes are related to this:
- Added new script menu entries: Render (for exporters to renderers), Themes, FaceSelect (this already at the proper place). Updated Scripts win->Scripts menu so it won't show all available entries, only the ones we mean to see there.
- Updated menu registration so that scripts folders can become trees. The release/scripts/ dir should be updated soon with subdirs like converters/, modifiers/, generators/ or whatever -- better discuss first (or is it? /me afraid of long irc discussions during meetings :) ).
- Modules:
Blender: added 'udatadir' option to .Get() function and added var Blender.mode to tell if Blender is in bg or interactive mode.
NMesh: added Campbell's nmesh.transform(matrix, recalc_normals = False) method (reworked, so my fault if it doesn't work).
- Bugs fixed:
#2123: http://projects.blender.org/tracker/?func=detail&atid=125&aid=2123&group_id=9
Reported by Ken Hughes (thanks!), who also found the exact problem later (it was in Text.Load, not with script links -- if only I had checked emails these days ... lost > 1 hour today to find the problem: passed filename to M_Text_Load was later being written over by a function called by add_text). Also saw that Text.Load wasn't checking existence of passed filename (duh!), now it does.
#1655: http://projects.blender.org/tracker/?func=detail&atid=125&aid=1655&group_id=9
Reported by Chris Want (thanks!): command line "blender -P script" not working properly for bg mode ("blender -b blendfile -P script").
Had to make some small updates to get it working (bg mode for scripts was never explicitely handled, it worked due to collateral effects, let's say), interested readers can check the report after I update it or the API_intro.py doc file. After more testing we can make further updates. Updated many places to not call redraws if in bg mode, now it is officially available. Blender outputs its own info when rendering in bg mode, if that is considered a nuissance we'll have to add a few "if (during_script())" calls outside bpython.
- Removed a few warnings here and there and also updated docs.
2005-03-19 06:24:55 +00:00
|
|
|
if (!G.background) {
|
|
|
|
oldsce = G.scene;
|
|
|
|
set_scene( self->scene );
|
|
|
|
BIF_do_render( 0 );
|
|
|
|
set_scene( oldsce );
|
|
|
|
}
|
|
|
|
|
|
|
|
else { /* background mode (blender -b file.blend -P script) */
|
|
|
|
|
|
|
|
int end_frame = G.scene->r.efra; /* is of type short currently */
|
|
|
|
|
|
|
|
if (G.scene != self->scene)
|
|
|
|
return EXPP_ReturnPyObjError (PyExc_RuntimeError,
|
|
|
|
"scene to render in bg mode must be the active scene");
|
|
|
|
|
|
|
|
G.scene->r.efra = G.scene->r.sfra;
|
|
|
|
|
|
|
|
RE_animrender(NULL);
|
|
|
|
|
|
|
|
G.scene->r.efra = end_frame;
|
|
|
|
}
|
|
|
|
|
2004-09-25 20:30:40 +00:00
|
|
|
return EXPP_incr_ret( Py_None );
|
2004-04-25 05:18:43 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------RenderData.RenderAnim() -----------
|
|
|
|
PyObject *RenderData_RenderAnim( BPy_RenderData * self )
|
2004-04-25 05:18:43 +00:00
|
|
|
{
|
2004-09-25 20:30:40 +00:00
|
|
|
Scene *oldsce;
|
2004-03-14 02:06:57 +00:00
|
|
|
|
BPython:
- Scripts:
fixed error in "Save Current Theme" which prevented it from automatically updating script registration in menus.
cosmetic changes in a couple of Campbell's sel_same.py script strings + more descriptive name for its new menu place (3d view, face mode -> select menu).
small updates to help_browser.py script.
The above changes are related to this:
- Added new script menu entries: Render (for exporters to renderers), Themes, FaceSelect (this already at the proper place). Updated Scripts win->Scripts menu so it won't show all available entries, only the ones we mean to see there.
- Updated menu registration so that scripts folders can become trees. The release/scripts/ dir should be updated soon with subdirs like converters/, modifiers/, generators/ or whatever -- better discuss first (or is it? /me afraid of long irc discussions during meetings :) ).
- Modules:
Blender: added 'udatadir' option to .Get() function and added var Blender.mode to tell if Blender is in bg or interactive mode.
NMesh: added Campbell's nmesh.transform(matrix, recalc_normals = False) method (reworked, so my fault if it doesn't work).
- Bugs fixed:
#2123: http://projects.blender.org/tracker/?func=detail&atid=125&aid=2123&group_id=9
Reported by Ken Hughes (thanks!), who also found the exact problem later (it was in Text.Load, not with script links -- if only I had checked emails these days ... lost > 1 hour today to find the problem: passed filename to M_Text_Load was later being written over by a function called by add_text). Also saw that Text.Load wasn't checking existence of passed filename (duh!), now it does.
#1655: http://projects.blender.org/tracker/?func=detail&atid=125&aid=1655&group_id=9
Reported by Chris Want (thanks!): command line "blender -P script" not working properly for bg mode ("blender -b blendfile -P script").
Had to make some small updates to get it working (bg mode for scripts was never explicitely handled, it worked due to collateral effects, let's say), interested readers can check the report after I update it or the API_intro.py doc file. After more testing we can make further updates. Updated many places to not call redraws if in bg mode, now it is officially available. Blender outputs its own info when rendering in bg mode, if that is considered a nuissance we'll have to add a few "if (during_script())" calls outside bpython.
- Removed a few warnings here and there and also updated docs.
2005-03-19 06:24:55 +00:00
|
|
|
if (!G.background) {
|
|
|
|
oldsce = G.scene;
|
|
|
|
set_scene( self->scene );
|
|
|
|
BIF_do_render( 1 );
|
|
|
|
set_scene( oldsce );
|
|
|
|
}
|
|
|
|
else { /* background mode (blender -b file.blend -P script) */
|
|
|
|
if (G.scene != self->scene)
|
|
|
|
return EXPP_ReturnPyObjError (PyExc_RuntimeError,
|
|
|
|
"scene to render in bg mode must be the active scene");
|
|
|
|
|
|
|
|
if (G.scene->r.sfra > G.scene->r.efra)
|
|
|
|
return EXPP_ReturnPyObjError (PyExc_RuntimeError,
|
|
|
|
"start frame must be less or equal to end frame");
|
|
|
|
RE_animrender(NULL);
|
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
return EXPP_incr_ret( Py_None );
|
2004-04-25 05:18:43 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------RenderData.Play() -----------------
|
|
|
|
PyObject *RenderData_Play( BPy_RenderData * self )
|
2004-03-14 02:06:57 +00:00
|
|
|
{
|
2004-09-25 20:30:40 +00:00
|
|
|
char file[FILE_MAXDIR + FILE_MAXFILE];
|
2004-04-25 05:18:43 +00:00
|
|
|
extern char bprogname[];
|
2004-09-25 20:30:40 +00:00
|
|
|
char str[FILE_MAXDIR + FILE_MAXFILE];
|
2004-04-25 05:18:43 +00:00
|
|
|
int pos[2], size[2];
|
|
|
|
char txt[64];
|
|
|
|
|
|
|
|
#ifdef WITH_QUICKTIME
|
2004-09-25 20:30:40 +00:00
|
|
|
if( self->renderContext->imtype == R_QUICKTIME ) {
|
|
|
|
|
|
|
|
strcpy( file, self->renderContext->pic );
|
2005-03-09 19:45:59 +00:00
|
|
|
BLI_convertstringcode( file, (char *) self->scene,
|
2004-09-25 20:30:40 +00:00
|
|
|
self->renderContext->cfra );
|
|
|
|
RE_make_existing_file( file );
|
|
|
|
if( strcasecmp( file + strlen( file ) - 4, ".mov" ) ) {
|
|
|
|
sprintf( txt, "%04d_%04d.mov",
|
|
|
|
( self->renderContext->sfra ),
|
|
|
|
( self->renderContext->efra ) );
|
|
|
|
strcat( file, txt );
|
2004-04-25 05:18:43 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
} else
|
2004-04-25 05:18:43 +00:00
|
|
|
#endif
|
|
|
|
{
|
|
|
|
|
2004-09-25 20:30:40 +00:00
|
|
|
strcpy( file, self->renderContext->pic );
|
|
|
|
BLI_convertstringcode( file, G.sce,
|
|
|
|
self->renderContext->cfra );
|
|
|
|
RE_make_existing_file( file );
|
|
|
|
if( strcasecmp( file + strlen( file ) - 4, ".avi" ) ) {
|
|
|
|
sprintf( txt, "%04d_%04d.avi",
|
|
|
|
( self->renderContext->sfra ),
|
|
|
|
( self->renderContext->efra ) );
|
|
|
|
strcat( file, txt );
|
2004-04-25 05:18:43 +00:00
|
|
|
}
|
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
if( BLI_exist( file ) ) {
|
Biiig commit! Thanks to 2-3 weeks of cvs freeze...
Render:
- New; support for dual CPU render (SDL thread)
Currently only works with alternating scanlines, but gives excellent
performance. For both normal render as unified implemented.
Note the "mutex" locks on z-transp buffer render and imbuf loads.
- This has been made possible by major cleanups in render code, especially
getting rid of globals (example Tin Tr Tg Tb Ta for textures) or struct
OSA or using Materials or Texture data to write to.
- Made normal render fully 4x32 floats too, and removed all old optimizes
with chars or shorts.
- Made normal render and unified render use same code for sky and halo
render, giving equal (and better) results for halo render. Old render
now also uses PostProcess options (brightness, mul, gamma)
- Added option ("FBuf") in F10 Output Panel, this keeps a 4x32 bits buffer
after render. Using PostProcess menu you will note an immediate re-
display of image too (32 bits RGBA)
- Added "Hue" and "Saturation" sliders to PostProcess options
- Render module is still not having a "nice" API, but amount of dependencies
went down a lot. Next todo: remove abusive "previewrender" code.
The last main global in Render (struct Render) now can be re-used for fully
controlling a render, to allow multiple "instances" of render to open.
- Renderwindow now displays a smal bar on top with the stats, and keeps the
stats after render too. Including "spare" page support.
Not only easier visible that way, but also to remove the awkward code that
was drawing stats in the Info header (extreme slow on some ATIs too)
- Cleaned up blendef.h and BKE_utildefines.h, these two had overlapping
defines.
- I might have forgotten stuff... and will write a nice doc on the architecture!
2004-12-27 19:28:52 +00:00
|
|
|
calc_renderwin_rectangle( G.winpos, pos, size );
|
2004-09-25 20:30:40 +00:00
|
|
|
sprintf( str, "%s -a -p %d %d \"%s\"", bprogname, pos[0],
|
|
|
|
pos[1], file );
|
|
|
|
system( str );
|
|
|
|
} else {
|
|
|
|
makepicstring( file, self->renderContext->sfra );
|
|
|
|
if( BLI_exist( file ) ) {
|
Biiig commit! Thanks to 2-3 weeks of cvs freeze...
Render:
- New; support for dual CPU render (SDL thread)
Currently only works with alternating scanlines, but gives excellent
performance. For both normal render as unified implemented.
Note the "mutex" locks on z-transp buffer render and imbuf loads.
- This has been made possible by major cleanups in render code, especially
getting rid of globals (example Tin Tr Tg Tb Ta for textures) or struct
OSA or using Materials or Texture data to write to.
- Made normal render fully 4x32 floats too, and removed all old optimizes
with chars or shorts.
- Made normal render and unified render use same code for sky and halo
render, giving equal (and better) results for halo render. Old render
now also uses PostProcess options (brightness, mul, gamma)
- Added option ("FBuf") in F10 Output Panel, this keeps a 4x32 bits buffer
after render. Using PostProcess menu you will note an immediate re-
display of image too (32 bits RGBA)
- Added "Hue" and "Saturation" sliders to PostProcess options
- Render module is still not having a "nice" API, but amount of dependencies
went down a lot. Next todo: remove abusive "previewrender" code.
The last main global in Render (struct Render) now can be re-used for fully
controlling a render, to allow multiple "instances" of render to open.
- Renderwindow now displays a smal bar on top with the stats, and keeps the
stats after render too. Including "spare" page support.
Not only easier visible that way, but also to remove the awkward code that
was drawing stats in the Info header (extreme slow on some ATIs too)
- Cleaned up blendef.h and BKE_utildefines.h, these two had overlapping
defines.
- I might have forgotten stuff... and will write a nice doc on the architecture!
2004-12-27 19:28:52 +00:00
|
|
|
calc_renderwin_rectangle( G.winpos, pos, size );
|
2004-09-25 20:30:40 +00:00
|
|
|
sprintf( str, "%s -a -p %d %d \"%s\"", bprogname,
|
|
|
|
pos[0], pos[1], file );
|
|
|
|
system( str );
|
|
|
|
} else
|
|
|
|
sprintf( "Can't find image: %s", file );
|
2004-04-25 05:18:43 +00:00
|
|
|
}
|
|
|
|
|
2004-09-25 20:30:40 +00:00
|
|
|
return EXPP_incr_ret( Py_None );
|
2004-03-14 02:06:57 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------RenderData.StRenderPath() ---------
|
|
|
|
PyObject *RenderData_SetRenderPath( BPy_RenderData * self, PyObject * args )
|
2004-04-25 05:18:43 +00:00
|
|
|
{
|
|
|
|
char *name;
|
2004-03-14 02:06:57 +00:00
|
|
|
|
2004-09-25 20:30:40 +00:00
|
|
|
if( !PyArg_ParseTuple( args, "s", &name ) )
|
|
|
|
return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
|
|
|
|
"expected a string" ) );
|
2004-04-25 05:18:43 +00:00
|
|
|
|
2004-09-25 20:30:40 +00:00
|
|
|
if( strlen( name ) > 160 )
|
|
|
|
return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
|
|
|
|
"path is too long (SetRenderPath)" ) );
|
2004-04-25 05:18:43 +00:00
|
|
|
|
2004-09-25 20:30:40 +00:00
|
|
|
strcpy( self->renderContext->pic, name );
|
BPython:
- Scripts:
fixed error in "Save Current Theme" which prevented it from automatically updating script registration in menus.
cosmetic changes in a couple of Campbell's sel_same.py script strings + more descriptive name for its new menu place (3d view, face mode -> select menu).
small updates to help_browser.py script.
The above changes are related to this:
- Added new script menu entries: Render (for exporters to renderers), Themes, FaceSelect (this already at the proper place). Updated Scripts win->Scripts menu so it won't show all available entries, only the ones we mean to see there.
- Updated menu registration so that scripts folders can become trees. The release/scripts/ dir should be updated soon with subdirs like converters/, modifiers/, generators/ or whatever -- better discuss first (or is it? /me afraid of long irc discussions during meetings :) ).
- Modules:
Blender: added 'udatadir' option to .Get() function and added var Blender.mode to tell if Blender is in bg or interactive mode.
NMesh: added Campbell's nmesh.transform(matrix, recalc_normals = False) method (reworked, so my fault if it doesn't work).
- Bugs fixed:
#2123: http://projects.blender.org/tracker/?func=detail&atid=125&aid=2123&group_id=9
Reported by Ken Hughes (thanks!), who also found the exact problem later (it was in Text.Load, not with script links -- if only I had checked emails these days ... lost > 1 hour today to find the problem: passed filename to M_Text_Load was later being written over by a function called by add_text). Also saw that Text.Load wasn't checking existence of passed filename (duh!), now it does.
#1655: http://projects.blender.org/tracker/?func=detail&atid=125&aid=1655&group_id=9
Reported by Chris Want (thanks!): command line "blender -P script" not working properly for bg mode ("blender -b blendfile -P script").
Had to make some small updates to get it working (bg mode for scripts was never explicitely handled, it worked due to collateral effects, let's say), interested readers can check the report after I update it or the API_intro.py doc file. After more testing we can make further updates. Updated many places to not call redraws if in bg mode, now it is officially available. Blender outputs its own info when rendering in bg mode, if that is considered a nuissance we'll have to add a few "if (during_script())" calls outside bpython.
- Removed a few warnings here and there and also updated docs.
2005-03-19 06:24:55 +00:00
|
|
|
EXPP_allqueue( REDRAWBUTSSCENE, 0 );
|
2004-04-25 05:18:43 +00:00
|
|
|
|
2004-09-25 20:30:40 +00:00
|
|
|
return EXPP_incr_ret( Py_None );
|
2004-04-25 05:18:43 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------RenderData.GetRenderPath() --------
|
|
|
|
PyObject *RenderData_GetRenderPath( BPy_RenderData * self )
|
2004-03-14 02:06:57 +00:00
|
|
|
{
|
2004-09-25 20:30:40 +00:00
|
|
|
return Py_BuildValue( "s", self->renderContext->pic );
|
2004-03-14 02:06:57 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------RenderData.SetBackbufPath() -------
|
|
|
|
PyObject *RenderData_SetBackbufPath( BPy_RenderData * self, PyObject * args )
|
2004-04-25 05:18:43 +00:00
|
|
|
{
|
|
|
|
char *name;
|
|
|
|
Image *ima;
|
2004-03-14 02:06:57 +00:00
|
|
|
|
2004-09-25 20:30:40 +00:00
|
|
|
if( !PyArg_ParseTuple( args, "s", &name ) )
|
|
|
|
return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
|
|
|
|
"expected a string" ) );
|
2004-04-25 05:18:43 +00:00
|
|
|
|
2004-09-25 20:30:40 +00:00
|
|
|
if( strlen( name ) > 160 )
|
|
|
|
return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
|
|
|
|
"path is too long (SetBackbufPath)" ) );
|
2004-04-25 05:18:43 +00:00
|
|
|
|
2004-09-25 20:30:40 +00:00
|
|
|
strcpy( self->renderContext->backbuf, name );
|
BPython:
- Scripts:
fixed error in "Save Current Theme" which prevented it from automatically updating script registration in menus.
cosmetic changes in a couple of Campbell's sel_same.py script strings + more descriptive name for its new menu place (3d view, face mode -> select menu).
small updates to help_browser.py script.
The above changes are related to this:
- Added new script menu entries: Render (for exporters to renderers), Themes, FaceSelect (this already at the proper place). Updated Scripts win->Scripts menu so it won't show all available entries, only the ones we mean to see there.
- Updated menu registration so that scripts folders can become trees. The release/scripts/ dir should be updated soon with subdirs like converters/, modifiers/, generators/ or whatever -- better discuss first (or is it? /me afraid of long irc discussions during meetings :) ).
- Modules:
Blender: added 'udatadir' option to .Get() function and added var Blender.mode to tell if Blender is in bg or interactive mode.
NMesh: added Campbell's nmesh.transform(matrix, recalc_normals = False) method (reworked, so my fault if it doesn't work).
- Bugs fixed:
#2123: http://projects.blender.org/tracker/?func=detail&atid=125&aid=2123&group_id=9
Reported by Ken Hughes (thanks!), who also found the exact problem later (it was in Text.Load, not with script links -- if only I had checked emails these days ... lost > 1 hour today to find the problem: passed filename to M_Text_Load was later being written over by a function called by add_text). Also saw that Text.Load wasn't checking existence of passed filename (duh!), now it does.
#1655: http://projects.blender.org/tracker/?func=detail&atid=125&aid=1655&group_id=9
Reported by Chris Want (thanks!): command line "blender -P script" not working properly for bg mode ("blender -b blendfile -P script").
Had to make some small updates to get it working (bg mode for scripts was never explicitely handled, it worked due to collateral effects, let's say), interested readers can check the report after I update it or the API_intro.py doc file. After more testing we can make further updates. Updated many places to not call redraws if in bg mode, now it is officially available. Blender outputs its own info when rendering in bg mode, if that is considered a nuissance we'll have to add a few "if (during_script())" calls outside bpython.
- Removed a few warnings here and there and also updated docs.
2005-03-19 06:24:55 +00:00
|
|
|
EXPP_allqueue( REDRAWBUTSSCENE, 0 );
|
2004-04-25 05:18:43 +00:00
|
|
|
|
2004-09-25 20:30:40 +00:00
|
|
|
ima = add_image( name );
|
|
|
|
if( ima ) {
|
|
|
|
free_image_buffers( ima );
|
|
|
|
ima->ok = 1;
|
2004-04-25 05:18:43 +00:00
|
|
|
}
|
|
|
|
|
2004-09-25 20:30:40 +00:00
|
|
|
return EXPP_incr_ret( Py_None );
|
2004-04-25 05:18:43 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------RenderData.GetBackbufPath() -------
|
|
|
|
PyObject *RenderData_GetBackbufPath( BPy_RenderData * self )
|
2004-03-14 02:06:57 +00:00
|
|
|
{
|
2004-09-25 20:30:40 +00:00
|
|
|
return Py_BuildValue( "s", self->renderContext->backbuf );
|
2004-03-14 02:06:57 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------RenderData.EnableBackbuf() --------
|
|
|
|
PyObject *RenderData_EnableBackbuf( BPy_RenderData * self, PyObject * args )
|
2004-03-14 02:06:57 +00:00
|
|
|
{
|
2004-09-25 20:30:40 +00:00
|
|
|
return M_Render_BitToggleShort( args, 1,
|
|
|
|
&self->renderContext->bufflag );
|
2004-03-14 02:06:57 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------RenderData.SetFtypePath() ---------
|
|
|
|
PyObject *RenderData_SetFtypePath( BPy_RenderData * self, PyObject * args )
|
2004-04-25 05:18:43 +00:00
|
|
|
{
|
|
|
|
char *name;
|
|
|
|
|
2004-09-25 20:30:40 +00:00
|
|
|
if( !PyArg_ParseTuple( args, "s", &name ) )
|
|
|
|
return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
|
|
|
|
"expected a string" ) );
|
2004-04-25 05:18:43 +00:00
|
|
|
|
2004-09-25 20:30:40 +00:00
|
|
|
if( strlen( name ) > 160 )
|
|
|
|
return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
|
|
|
|
"path is too long (SetFtypePath)" ) );
|
2004-04-25 05:18:43 +00:00
|
|
|
|
2004-09-25 20:30:40 +00:00
|
|
|
strcpy( self->renderContext->ftype, name );
|
BPython:
- Scripts:
fixed error in "Save Current Theme" which prevented it from automatically updating script registration in menus.
cosmetic changes in a couple of Campbell's sel_same.py script strings + more descriptive name for its new menu place (3d view, face mode -> select menu).
small updates to help_browser.py script.
The above changes are related to this:
- Added new script menu entries: Render (for exporters to renderers), Themes, FaceSelect (this already at the proper place). Updated Scripts win->Scripts menu so it won't show all available entries, only the ones we mean to see there.
- Updated menu registration so that scripts folders can become trees. The release/scripts/ dir should be updated soon with subdirs like converters/, modifiers/, generators/ or whatever -- better discuss first (or is it? /me afraid of long irc discussions during meetings :) ).
- Modules:
Blender: added 'udatadir' option to .Get() function and added var Blender.mode to tell if Blender is in bg or interactive mode.
NMesh: added Campbell's nmesh.transform(matrix, recalc_normals = False) method (reworked, so my fault if it doesn't work).
- Bugs fixed:
#2123: http://projects.blender.org/tracker/?func=detail&atid=125&aid=2123&group_id=9
Reported by Ken Hughes (thanks!), who also found the exact problem later (it was in Text.Load, not with script links -- if only I had checked emails these days ... lost > 1 hour today to find the problem: passed filename to M_Text_Load was later being written over by a function called by add_text). Also saw that Text.Load wasn't checking existence of passed filename (duh!), now it does.
#1655: http://projects.blender.org/tracker/?func=detail&atid=125&aid=1655&group_id=9
Reported by Chris Want (thanks!): command line "blender -P script" not working properly for bg mode ("blender -b blendfile -P script").
Had to make some small updates to get it working (bg mode for scripts was never explicitely handled, it worked due to collateral effects, let's say), interested readers can check the report after I update it or the API_intro.py doc file. After more testing we can make further updates. Updated many places to not call redraws if in bg mode, now it is officially available. Blender outputs its own info when rendering in bg mode, if that is considered a nuissance we'll have to add a few "if (during_script())" calls outside bpython.
- Removed a few warnings here and there and also updated docs.
2005-03-19 06:24:55 +00:00
|
|
|
EXPP_allqueue( REDRAWBUTSSCENE, 0 );
|
2004-03-14 02:06:57 +00:00
|
|
|
|
2004-09-25 20:30:40 +00:00
|
|
|
return EXPP_incr_ret( Py_None );
|
2004-04-25 05:18:43 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------RenderData.GetFtypePath() ---------
|
|
|
|
PyObject *RenderData_GetFtypePath( BPy_RenderData * self )
|
2004-04-25 05:18:43 +00:00
|
|
|
{
|
2004-09-25 20:30:40 +00:00
|
|
|
return Py_BuildValue( "s", self->renderContext->ftype );
|
2004-04-25 05:18:43 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------RenderData.EnableExtensions() -----
|
|
|
|
PyObject *RenderData_EnableExtensions( BPy_RenderData * self, PyObject * args )
|
2004-04-25 05:18:43 +00:00
|
|
|
{
|
2004-09-25 20:30:40 +00:00
|
|
|
return M_Render_BitToggleShort( args, R_EXTENSION,
|
|
|
|
&self->renderContext->scemode );
|
2004-04-25 05:18:43 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------RenderData.EnableSequencer() ------
|
|
|
|
PyObject *RenderData_EnableSequencer( BPy_RenderData * self, PyObject * args )
|
2004-04-25 05:18:43 +00:00
|
|
|
{
|
2004-09-25 20:30:40 +00:00
|
|
|
return M_Render_BitToggleShort( args, R_DOSEQ,
|
|
|
|
&self->renderContext->scemode );
|
2004-04-25 05:18:43 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------RenderData.EnableRenderDaemon() ---
|
|
|
|
PyObject *RenderData_EnableRenderDaemon( BPy_RenderData * self,
|
|
|
|
PyObject * args )
|
2004-04-25 05:18:43 +00:00
|
|
|
{
|
2004-09-25 20:30:40 +00:00
|
|
|
return M_Render_BitToggleShort( args, R_BG_RENDER,
|
|
|
|
&self->renderContext->scemode );
|
2004-04-25 05:18:43 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------RenderData.EnableToonShading() ----
|
|
|
|
PyObject *RenderData_EnableToonShading( BPy_RenderData * self,
|
|
|
|
PyObject * args )
|
2004-04-25 05:18:43 +00:00
|
|
|
{
|
2004-09-25 20:30:40 +00:00
|
|
|
return M_Render_BitToggleInt( args, R_EDGE,
|
|
|
|
&self->renderContext->mode );
|
2004-04-25 05:18:43 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------RenderData.EdgeIntensity() --------
|
|
|
|
PyObject *RenderData_EdgeIntensity( BPy_RenderData * self, PyObject * args )
|
2004-04-25 05:18:43 +00:00
|
|
|
{
|
2004-09-25 20:30:40 +00:00
|
|
|
return M_Render_GetSetAttributeShort( args,
|
|
|
|
&self->renderContext->edgeint, 0,
|
|
|
|
255 );
|
2004-04-25 05:18:43 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------RenderData.SetEdgeColor() ---------
|
|
|
|
PyObject *RenderData_SetEdgeColor( BPy_RenderData * self, PyObject * args )
|
2004-03-14 02:06:57 +00:00
|
|
|
{
|
|
|
|
float red = 0.0f;
|
|
|
|
float green = 0.0f;
|
|
|
|
float blue = 0.0f;
|
|
|
|
|
2004-09-25 20:30:40 +00:00
|
|
|
if( !PyArg_ParseTuple( args, "fff", &red, &green, &blue ) )
|
|
|
|
return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
|
|
|
|
"expected three floats" ) );
|
2004-03-14 02:06:57 +00:00
|
|
|
|
2004-09-25 20:30:40 +00:00
|
|
|
if( red < 0 || red > 1 )
|
|
|
|
return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
|
|
|
|
"value out of range 0.000 - 1.000 (red)" ) );
|
|
|
|
if( green < 0 || green > 1 )
|
|
|
|
return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
|
|
|
|
"value out of range 0.000 - 1.000 (green)" ) );
|
|
|
|
if( blue < 0 || blue > 1 )
|
|
|
|
return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
|
|
|
|
"value out of range 0.000 - 1.000 (blue)" ) );
|
2004-03-14 02:06:57 +00:00
|
|
|
|
2004-04-25 05:18:43 +00:00
|
|
|
self->renderContext->edgeR = red;
|
|
|
|
self->renderContext->edgeG = green;
|
|
|
|
self->renderContext->edgeB = blue;
|
2004-03-14 02:06:57 +00:00
|
|
|
|
2004-09-25 20:30:40 +00:00
|
|
|
return EXPP_incr_ret( Py_None );
|
2004-03-14 02:06:57 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------RenderData.GetEdgeColor() ---------
|
|
|
|
PyObject *RenderData_GetEdgeColor( BPy_RenderData * self )
|
2004-03-14 02:06:57 +00:00
|
|
|
{
|
|
|
|
char rgb[24];
|
|
|
|
|
2004-09-25 20:30:40 +00:00
|
|
|
sprintf( rgb, "[%.3f,%.3f,%.3f]\n", self->renderContext->edgeR,
|
|
|
|
self->renderContext->edgeG, self->renderContext->edgeB );
|
|
|
|
return PyString_FromString( rgb );
|
2004-03-14 02:06:57 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------RenderData.EdgeAntiShift() --------
|
|
|
|
PyObject *RenderData_EdgeAntiShift( BPy_RenderData * self, PyObject * args )
|
2004-03-14 02:06:57 +00:00
|
|
|
{
|
2004-09-25 20:30:40 +00:00
|
|
|
return M_Render_GetSetAttributeShort( args,
|
|
|
|
&self->renderContext->
|
|
|
|
same_mat_redux, 0, 255 );
|
2004-03-14 02:06:57 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------RenderData.EnableOversampling() ---
|
|
|
|
PyObject *RenderData_EnableOversampling( BPy_RenderData * self,
|
|
|
|
PyObject * args )
|
2004-03-14 02:06:57 +00:00
|
|
|
{
|
2004-09-25 20:30:40 +00:00
|
|
|
return M_Render_BitToggleInt( args, R_OSA,
|
|
|
|
&self->renderContext->mode );
|
2004-03-14 02:06:57 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------RenderData.SetOversamplingLevel() -
|
|
|
|
PyObject *RenderData_SetOversamplingLevel( BPy_RenderData * self,
|
|
|
|
PyObject * args )
|
2004-03-14 02:06:57 +00:00
|
|
|
{
|
|
|
|
int level;
|
|
|
|
|
2004-09-25 20:30:40 +00:00
|
|
|
if( !PyArg_ParseTuple( args, "i", &level ) )
|
|
|
|
return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
|
|
|
|
"expected int" ) );
|
2004-03-14 02:06:57 +00:00
|
|
|
|
2004-09-25 20:30:40 +00:00
|
|
|
if( level != 5 && level != 8 && level != 11 && level != 16 )
|
|
|
|
return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
|
|
|
|
"expected 5,8,11, or 16" ) );
|
2004-03-14 02:06:57 +00:00
|
|
|
|
2004-04-25 05:18:43 +00:00
|
|
|
self->renderContext->osa = level;
|
BPython:
- Scripts:
fixed error in "Save Current Theme" which prevented it from automatically updating script registration in menus.
cosmetic changes in a couple of Campbell's sel_same.py script strings + more descriptive name for its new menu place (3d view, face mode -> select menu).
small updates to help_browser.py script.
The above changes are related to this:
- Added new script menu entries: Render (for exporters to renderers), Themes, FaceSelect (this already at the proper place). Updated Scripts win->Scripts menu so it won't show all available entries, only the ones we mean to see there.
- Updated menu registration so that scripts folders can become trees. The release/scripts/ dir should be updated soon with subdirs like converters/, modifiers/, generators/ or whatever -- better discuss first (or is it? /me afraid of long irc discussions during meetings :) ).
- Modules:
Blender: added 'udatadir' option to .Get() function and added var Blender.mode to tell if Blender is in bg or interactive mode.
NMesh: added Campbell's nmesh.transform(matrix, recalc_normals = False) method (reworked, so my fault if it doesn't work).
- Bugs fixed:
#2123: http://projects.blender.org/tracker/?func=detail&atid=125&aid=2123&group_id=9
Reported by Ken Hughes (thanks!), who also found the exact problem later (it was in Text.Load, not with script links -- if only I had checked emails these days ... lost > 1 hour today to find the problem: passed filename to M_Text_Load was later being written over by a function called by add_text). Also saw that Text.Load wasn't checking existence of passed filename (duh!), now it does.
#1655: http://projects.blender.org/tracker/?func=detail&atid=125&aid=1655&group_id=9
Reported by Chris Want (thanks!): command line "blender -P script" not working properly for bg mode ("blender -b blendfile -P script").
Had to make some small updates to get it working (bg mode for scripts was never explicitely handled, it worked due to collateral effects, let's say), interested readers can check the report after I update it or the API_intro.py doc file. After more testing we can make further updates. Updated many places to not call redraws if in bg mode, now it is officially available. Blender outputs its own info when rendering in bg mode, if that is considered a nuissance we'll have to add a few "if (during_script())" calls outside bpython.
- Removed a few warnings here and there and also updated docs.
2005-03-19 06:24:55 +00:00
|
|
|
EXPP_allqueue( REDRAWBUTSSCENE, 0 );
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
return EXPP_incr_ret( Py_None );
|
2004-03-14 02:06:57 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------RenderData.EnableMotionBlur() -----
|
|
|
|
PyObject *RenderData_EnableMotionBlur( BPy_RenderData * self, PyObject * args )
|
2004-03-14 02:06:57 +00:00
|
|
|
{
|
2004-09-25 20:30:40 +00:00
|
|
|
return M_Render_BitToggleInt( args, R_MBLUR,
|
|
|
|
&self->renderContext->mode );
|
2004-03-14 02:06:57 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------RenderData.MotionBlurLevel() ------
|
|
|
|
PyObject *RenderData_MotionBlurLevel( BPy_RenderData * self, PyObject * args )
|
2004-03-14 02:06:57 +00:00
|
|
|
{
|
2004-09-25 20:30:40 +00:00
|
|
|
return M_Render_GetSetAttributeFloat( args,
|
|
|
|
&self->renderContext->blurfac,
|
|
|
|
0.01f, 5.0f );
|
2004-03-14 02:06:57 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------RenderData.PartsX() ---------------
|
|
|
|
PyObject *RenderData_PartsX( BPy_RenderData * self, PyObject * args )
|
2004-03-14 02:06:57 +00:00
|
|
|
{
|
2004-09-25 20:30:40 +00:00
|
|
|
return M_Render_GetSetAttributeShort( args,
|
|
|
|
&self->renderContext->xparts, 1,
|
|
|
|
64 );
|
2004-03-14 02:06:57 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------RenderData.PartsY() ---------------
|
|
|
|
PyObject *RenderData_PartsY( BPy_RenderData * self, PyObject * args )
|
2004-03-14 02:06:57 +00:00
|
|
|
{
|
2004-09-25 20:30:40 +00:00
|
|
|
return M_Render_GetSetAttributeShort( args,
|
|
|
|
&self->renderContext->yparts, 1,
|
|
|
|
64 );
|
2004-03-14 02:06:57 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------RenderData.EnableSky() ------------
|
|
|
|
PyObject *RenderData_EnableSky( BPy_RenderData * self )
|
2004-03-14 02:06:57 +00:00
|
|
|
{
|
2004-04-25 05:18:43 +00:00
|
|
|
self->renderContext->alphamode = R_ADDSKY;
|
BPython:
- Scripts:
fixed error in "Save Current Theme" which prevented it from automatically updating script registration in menus.
cosmetic changes in a couple of Campbell's sel_same.py script strings + more descriptive name for its new menu place (3d view, face mode -> select menu).
small updates to help_browser.py script.
The above changes are related to this:
- Added new script menu entries: Render (for exporters to renderers), Themes, FaceSelect (this already at the proper place). Updated Scripts win->Scripts menu so it won't show all available entries, only the ones we mean to see there.
- Updated menu registration so that scripts folders can become trees. The release/scripts/ dir should be updated soon with subdirs like converters/, modifiers/, generators/ or whatever -- better discuss first (or is it? /me afraid of long irc discussions during meetings :) ).
- Modules:
Blender: added 'udatadir' option to .Get() function and added var Blender.mode to tell if Blender is in bg or interactive mode.
NMesh: added Campbell's nmesh.transform(matrix, recalc_normals = False) method (reworked, so my fault if it doesn't work).
- Bugs fixed:
#2123: http://projects.blender.org/tracker/?func=detail&atid=125&aid=2123&group_id=9
Reported by Ken Hughes (thanks!), who also found the exact problem later (it was in Text.Load, not with script links -- if only I had checked emails these days ... lost > 1 hour today to find the problem: passed filename to M_Text_Load was later being written over by a function called by add_text). Also saw that Text.Load wasn't checking existence of passed filename (duh!), now it does.
#1655: http://projects.blender.org/tracker/?func=detail&atid=125&aid=1655&group_id=9
Reported by Chris Want (thanks!): command line "blender -P script" not working properly for bg mode ("blender -b blendfile -P script").
Had to make some small updates to get it working (bg mode for scripts was never explicitely handled, it worked due to collateral effects, let's say), interested readers can check the report after I update it or the API_intro.py doc file. After more testing we can make further updates. Updated many places to not call redraws if in bg mode, now it is officially available. Blender outputs its own info when rendering in bg mode, if that is considered a nuissance we'll have to add a few "if (during_script())" calls outside bpython.
- Removed a few warnings here and there and also updated docs.
2005-03-19 06:24:55 +00:00
|
|
|
EXPP_allqueue( REDRAWBUTSSCENE, 0 );
|
2004-03-14 02:06:57 +00:00
|
|
|
|
2004-09-25 20:30:40 +00:00
|
|
|
return EXPP_incr_ret( Py_None );
|
2004-03-14 02:06:57 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------RenderData.EnablePremultiply() ----
|
|
|
|
PyObject *RenderData_EnablePremultiply( BPy_RenderData * self )
|
2004-03-14 02:06:57 +00:00
|
|
|
{
|
2004-04-25 05:18:43 +00:00
|
|
|
self->renderContext->alphamode = R_ALPHAPREMUL;
|
BPython:
- Scripts:
fixed error in "Save Current Theme" which prevented it from automatically updating script registration in menus.
cosmetic changes in a couple of Campbell's sel_same.py script strings + more descriptive name for its new menu place (3d view, face mode -> select menu).
small updates to help_browser.py script.
The above changes are related to this:
- Added new script menu entries: Render (for exporters to renderers), Themes, FaceSelect (this already at the proper place). Updated Scripts win->Scripts menu so it won't show all available entries, only the ones we mean to see there.
- Updated menu registration so that scripts folders can become trees. The release/scripts/ dir should be updated soon with subdirs like converters/, modifiers/, generators/ or whatever -- better discuss first (or is it? /me afraid of long irc discussions during meetings :) ).
- Modules:
Blender: added 'udatadir' option to .Get() function and added var Blender.mode to tell if Blender is in bg or interactive mode.
NMesh: added Campbell's nmesh.transform(matrix, recalc_normals = False) method (reworked, so my fault if it doesn't work).
- Bugs fixed:
#2123: http://projects.blender.org/tracker/?func=detail&atid=125&aid=2123&group_id=9
Reported by Ken Hughes (thanks!), who also found the exact problem later (it was in Text.Load, not with script links -- if only I had checked emails these days ... lost > 1 hour today to find the problem: passed filename to M_Text_Load was later being written over by a function called by add_text). Also saw that Text.Load wasn't checking existence of passed filename (duh!), now it does.
#1655: http://projects.blender.org/tracker/?func=detail&atid=125&aid=1655&group_id=9
Reported by Chris Want (thanks!): command line "blender -P script" not working properly for bg mode ("blender -b blendfile -P script").
Had to make some small updates to get it working (bg mode for scripts was never explicitely handled, it worked due to collateral effects, let's say), interested readers can check the report after I update it or the API_intro.py doc file. After more testing we can make further updates. Updated many places to not call redraws if in bg mode, now it is officially available. Blender outputs its own info when rendering in bg mode, if that is considered a nuissance we'll have to add a few "if (during_script())" calls outside bpython.
- Removed a few warnings here and there and also updated docs.
2005-03-19 06:24:55 +00:00
|
|
|
EXPP_allqueue( REDRAWBUTSSCENE, 0 );
|
2004-03-14 02:06:57 +00:00
|
|
|
|
2004-09-25 20:30:40 +00:00
|
|
|
return EXPP_incr_ret( Py_None );
|
2004-03-14 02:06:57 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------RenderData.EnableKey() ------------
|
|
|
|
PyObject *RenderData_EnableKey( BPy_RenderData * self )
|
2004-03-14 02:06:57 +00:00
|
|
|
{
|
2004-04-25 05:18:43 +00:00
|
|
|
self->renderContext->alphamode = R_ALPHAKEY;
|
BPython:
- Scripts:
fixed error in "Save Current Theme" which prevented it from automatically updating script registration in menus.
cosmetic changes in a couple of Campbell's sel_same.py script strings + more descriptive name for its new menu place (3d view, face mode -> select menu).
small updates to help_browser.py script.
The above changes are related to this:
- Added new script menu entries: Render (for exporters to renderers), Themes, FaceSelect (this already at the proper place). Updated Scripts win->Scripts menu so it won't show all available entries, only the ones we mean to see there.
- Updated menu registration so that scripts folders can become trees. The release/scripts/ dir should be updated soon with subdirs like converters/, modifiers/, generators/ or whatever -- better discuss first (or is it? /me afraid of long irc discussions during meetings :) ).
- Modules:
Blender: added 'udatadir' option to .Get() function and added var Blender.mode to tell if Blender is in bg or interactive mode.
NMesh: added Campbell's nmesh.transform(matrix, recalc_normals = False) method (reworked, so my fault if it doesn't work).
- Bugs fixed:
#2123: http://projects.blender.org/tracker/?func=detail&atid=125&aid=2123&group_id=9
Reported by Ken Hughes (thanks!), who also found the exact problem later (it was in Text.Load, not with script links -- if only I had checked emails these days ... lost > 1 hour today to find the problem: passed filename to M_Text_Load was later being written over by a function called by add_text). Also saw that Text.Load wasn't checking existence of passed filename (duh!), now it does.
#1655: http://projects.blender.org/tracker/?func=detail&atid=125&aid=1655&group_id=9
Reported by Chris Want (thanks!): command line "blender -P script" not working properly for bg mode ("blender -b blendfile -P script").
Had to make some small updates to get it working (bg mode for scripts was never explicitely handled, it worked due to collateral effects, let's say), interested readers can check the report after I update it or the API_intro.py doc file. After more testing we can make further updates. Updated many places to not call redraws if in bg mode, now it is officially available. Blender outputs its own info when rendering in bg mode, if that is considered a nuissance we'll have to add a few "if (during_script())" calls outside bpython.
- Removed a few warnings here and there and also updated docs.
2005-03-19 06:24:55 +00:00
|
|
|
EXPP_allqueue( REDRAWBUTSSCENE, 0 );
|
2004-03-14 02:06:57 +00:00
|
|
|
|
2004-09-25 20:30:40 +00:00
|
|
|
return EXPP_incr_ret( Py_None );
|
2004-03-14 02:06:57 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------RenderData.EnableShadow() ---------
|
|
|
|
PyObject *RenderData_EnableShadow( BPy_RenderData * self, PyObject * args )
|
2004-03-14 02:06:57 +00:00
|
|
|
{
|
2004-09-25 20:30:40 +00:00
|
|
|
return M_Render_BitToggleInt( args, R_SHADOW,
|
|
|
|
&self->renderContext->mode );
|
2004-03-14 02:06:57 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------RenderData.EnvironmentMap() -------
|
|
|
|
PyObject *RenderData_EnableEnvironmentMap( BPy_RenderData * self,
|
|
|
|
PyObject * args )
|
2004-03-14 02:06:57 +00:00
|
|
|
{
|
2004-09-25 20:30:40 +00:00
|
|
|
return M_Render_BitToggleInt( args, R_ENVMAP,
|
|
|
|
&self->renderContext->mode );
|
2004-03-14 02:06:57 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------RenderData.EnablePanorama() -------
|
|
|
|
PyObject *RenderData_EnablePanorama( BPy_RenderData * self, PyObject * args )
|
2004-03-14 02:06:57 +00:00
|
|
|
{
|
2004-09-25 20:30:40 +00:00
|
|
|
return M_Render_BitToggleInt( args, R_PANORAMA,
|
|
|
|
&self->renderContext->mode );
|
2004-03-14 02:06:57 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------RenderData.EnableRayTracing() -----
|
|
|
|
PyObject *RenderData_EnableRayTracing( BPy_RenderData * self, PyObject * args )
|
2004-03-14 02:06:57 +00:00
|
|
|
{
|
2004-09-25 20:30:40 +00:00
|
|
|
return M_Render_BitToggleInt( args, R_RAYTRACE,
|
|
|
|
&self->renderContext->mode );
|
2004-03-14 02:06:57 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------RenderData.EnableRadiosityRender()
|
|
|
|
PyObject *RenderData_EnableRadiosityRender( BPy_RenderData * self,
|
|
|
|
PyObject * args )
|
2004-03-14 02:06:57 +00:00
|
|
|
{
|
2004-09-25 20:30:40 +00:00
|
|
|
return M_Render_BitToggleInt( args, R_RADIO,
|
|
|
|
&self->renderContext->mode );
|
2004-03-14 02:06:57 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------RenderData.SetRenderWinSize() -----
|
|
|
|
PyObject *RenderData_SetRenderWinSize( BPy_RenderData * self, PyObject * args )
|
2004-03-14 02:06:57 +00:00
|
|
|
{
|
|
|
|
int size;
|
|
|
|
|
2004-09-25 20:30:40 +00:00
|
|
|
if( !PyArg_ParseTuple( args, "i", &size ) )
|
|
|
|
return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
|
|
|
|
"expected int" ) );
|
2004-03-14 02:06:57 +00:00
|
|
|
|
2004-09-25 20:30:40 +00:00
|
|
|
if( size != 25 && size != 50 && size != 75 && size != 100 )
|
|
|
|
return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
|
|
|
|
"expected 25, 50, 75, or 100" ) );
|
2004-03-14 02:06:57 +00:00
|
|
|
|
2004-04-25 05:18:43 +00:00
|
|
|
self->renderContext->size = size;
|
BPython:
- Scripts:
fixed error in "Save Current Theme" which prevented it from automatically updating script registration in menus.
cosmetic changes in a couple of Campbell's sel_same.py script strings + more descriptive name for its new menu place (3d view, face mode -> select menu).
small updates to help_browser.py script.
The above changes are related to this:
- Added new script menu entries: Render (for exporters to renderers), Themes, FaceSelect (this already at the proper place). Updated Scripts win->Scripts menu so it won't show all available entries, only the ones we mean to see there.
- Updated menu registration so that scripts folders can become trees. The release/scripts/ dir should be updated soon with subdirs like converters/, modifiers/, generators/ or whatever -- better discuss first (or is it? /me afraid of long irc discussions during meetings :) ).
- Modules:
Blender: added 'udatadir' option to .Get() function and added var Blender.mode to tell if Blender is in bg or interactive mode.
NMesh: added Campbell's nmesh.transform(matrix, recalc_normals = False) method (reworked, so my fault if it doesn't work).
- Bugs fixed:
#2123: http://projects.blender.org/tracker/?func=detail&atid=125&aid=2123&group_id=9
Reported by Ken Hughes (thanks!), who also found the exact problem later (it was in Text.Load, not with script links -- if only I had checked emails these days ... lost > 1 hour today to find the problem: passed filename to M_Text_Load was later being written over by a function called by add_text). Also saw that Text.Load wasn't checking existence of passed filename (duh!), now it does.
#1655: http://projects.blender.org/tracker/?func=detail&atid=125&aid=1655&group_id=9
Reported by Chris Want (thanks!): command line "blender -P script" not working properly for bg mode ("blender -b blendfile -P script").
Had to make some small updates to get it working (bg mode for scripts was never explicitely handled, it worked due to collateral effects, let's say), interested readers can check the report after I update it or the API_intro.py doc file. After more testing we can make further updates. Updated many places to not call redraws if in bg mode, now it is officially available. Blender outputs its own info when rendering in bg mode, if that is considered a nuissance we'll have to add a few "if (during_script())" calls outside bpython.
- Removed a few warnings here and there and also updated docs.
2005-03-19 06:24:55 +00:00
|
|
|
EXPP_allqueue( REDRAWBUTSSCENE, 0 );
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
return EXPP_incr_ret( Py_None );
|
2004-03-14 02:06:57 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------RenderData.EnableFieldRendering() -
|
|
|
|
PyObject *RenderData_EnableFieldRendering( BPy_RenderData * self,
|
|
|
|
PyObject * args )
|
2004-03-14 02:06:57 +00:00
|
|
|
{
|
2004-09-25 20:30:40 +00:00
|
|
|
return M_Render_BitToggleInt( args, R_FIELDS,
|
|
|
|
&self->renderContext->mode );
|
2004-03-14 02:06:57 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------RenderData.EnableOddFieldFirst() --
|
|
|
|
PyObject *RenderData_EnableOddFieldFirst( BPy_RenderData * self,
|
|
|
|
PyObject * args )
|
2004-03-14 02:06:57 +00:00
|
|
|
{
|
2004-09-25 20:30:40 +00:00
|
|
|
return M_Render_BitToggleInt( args, R_ODDFIELD,
|
|
|
|
&self->renderContext->mode );
|
2004-03-14 02:06:57 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------RenderData.EnableFieldTimeDisable()
|
|
|
|
PyObject *RenderData_EnableFieldTimeDisable( BPy_RenderData * self,
|
|
|
|
PyObject * args )
|
2004-03-14 02:06:57 +00:00
|
|
|
{
|
2004-09-25 20:30:40 +00:00
|
|
|
return M_Render_BitToggleInt( args, R_FIELDSTILL,
|
|
|
|
&self->renderContext->mode );
|
2004-03-14 02:06:57 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------RenderData.EnableGaussFilter() ----
|
|
|
|
PyObject *RenderData_EnableGaussFilter( BPy_RenderData * self,
|
|
|
|
PyObject * args )
|
2004-03-14 02:06:57 +00:00
|
|
|
{
|
2004-09-25 20:30:40 +00:00
|
|
|
return M_Render_BitToggleInt( args, R_GAUSS,
|
|
|
|
&self->renderContext->mode );
|
2004-03-14 02:06:57 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------RenderData.EnableBorderRender() ---
|
|
|
|
PyObject *RenderData_EnableBorderRender( BPy_RenderData * self,
|
|
|
|
PyObject * args )
|
2004-03-14 02:06:57 +00:00
|
|
|
{
|
2004-09-25 20:30:40 +00:00
|
|
|
return M_Render_BitToggleInt( args, R_BORDER,
|
|
|
|
&self->renderContext->mode );
|
2004-03-14 02:06:57 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------RenderData.SetBorder() ------------
|
|
|
|
PyObject *RenderData_SetBorder( BPy_RenderData * self, PyObject * args )
|
2004-05-15 14:32:21 +00:00
|
|
|
{
|
2004-09-25 20:30:40 +00:00
|
|
|
float xmin, ymin, xmax, ymax;
|
2004-05-15 14:32:21 +00:00
|
|
|
int status = 0;
|
|
|
|
PyObject *ob_args;
|
2004-09-25 20:30:40 +00:00
|
|
|
|
2004-05-15 14:32:21 +00:00
|
|
|
//left,botton | right,top coords - in that order
|
2004-09-25 20:30:40 +00:00
|
|
|
if( PyObject_Length( args ) == 4 ) {
|
|
|
|
status = PyArg_ParseTuple( args, "ffff", &xmin, &ymin, &xmax,
|
|
|
|
&ymax );
|
|
|
|
} else {
|
|
|
|
if( PyArg_ParseTuple( args, "O", &ob_args ) ) {
|
|
|
|
if( PyList_Check( ob_args ) )
|
|
|
|
status = PyArg_ParseTuple( args, "(ffff)",
|
|
|
|
&xmin, &ymin, &xmax,
|
|
|
|
&ymax );
|
|
|
|
else {
|
2004-05-15 14:32:21 +00:00
|
|
|
status = 0;
|
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
} else {
|
2004-05-15 14:32:21 +00:00
|
|
|
status = 0;
|
|
|
|
}
|
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
if( !status ) /* parsing args failed */
|
|
|
|
return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
|
|
|
|
"expected four floats" ) );
|
|
|
|
if( xmin > 1.0 || xmin < 0.0 || ymin > 1.0 || ymin < 0.0 ||
|
|
|
|
xmax > 1.0 || xmax < 0.0 || ymax > 1.0 || ymax < 0.0 )
|
|
|
|
return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
|
|
|
|
"all values must be between 0.0 and 1.0" ) );
|
|
|
|
|
2004-05-15 14:32:21 +00:00
|
|
|
self->renderContext->border.xmin = xmin;
|
|
|
|
self->renderContext->border.ymin = ymin;
|
|
|
|
self->renderContext->border.xmax = xmax;
|
|
|
|
self->renderContext->border.ymax = ymax;
|
|
|
|
|
BPython:
- Scripts:
fixed error in "Save Current Theme" which prevented it from automatically updating script registration in menus.
cosmetic changes in a couple of Campbell's sel_same.py script strings + more descriptive name for its new menu place (3d view, face mode -> select menu).
small updates to help_browser.py script.
The above changes are related to this:
- Added new script menu entries: Render (for exporters to renderers), Themes, FaceSelect (this already at the proper place). Updated Scripts win->Scripts menu so it won't show all available entries, only the ones we mean to see there.
- Updated menu registration so that scripts folders can become trees. The release/scripts/ dir should be updated soon with subdirs like converters/, modifiers/, generators/ or whatever -- better discuss first (or is it? /me afraid of long irc discussions during meetings :) ).
- Modules:
Blender: added 'udatadir' option to .Get() function and added var Blender.mode to tell if Blender is in bg or interactive mode.
NMesh: added Campbell's nmesh.transform(matrix, recalc_normals = False) method (reworked, so my fault if it doesn't work).
- Bugs fixed:
#2123: http://projects.blender.org/tracker/?func=detail&atid=125&aid=2123&group_id=9
Reported by Ken Hughes (thanks!), who also found the exact problem later (it was in Text.Load, not with script links -- if only I had checked emails these days ... lost > 1 hour today to find the problem: passed filename to M_Text_Load was later being written over by a function called by add_text). Also saw that Text.Load wasn't checking existence of passed filename (duh!), now it does.
#1655: http://projects.blender.org/tracker/?func=detail&atid=125&aid=1655&group_id=9
Reported by Chris Want (thanks!): command line "blender -P script" not working properly for bg mode ("blender -b blendfile -P script").
Had to make some small updates to get it working (bg mode for scripts was never explicitely handled, it worked due to collateral effects, let's say), interested readers can check the report after I update it or the API_intro.py doc file. After more testing we can make further updates. Updated many places to not call redraws if in bg mode, now it is officially available. Blender outputs its own info when rendering in bg mode, if that is considered a nuissance we'll have to add a few "if (during_script())" calls outside bpython.
- Removed a few warnings here and there and also updated docs.
2005-03-19 06:24:55 +00:00
|
|
|
EXPP_allqueue( REDRAWVIEWCAM, 1 );
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
return EXPP_incr_ret( Py_None );
|
2004-05-15 14:32:21 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------RenderData.EnableGammaCorrection()
|
|
|
|
PyObject *RenderData_EnableGammaCorrection( BPy_RenderData * self,
|
|
|
|
PyObject * args )
|
2004-03-14 02:06:57 +00:00
|
|
|
{
|
2004-09-25 20:30:40 +00:00
|
|
|
return M_Render_BitToggleInt( args, R_GAMMA,
|
|
|
|
&self->renderContext->mode );
|
2004-03-14 02:06:57 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------RenderData.GaussFilterSize() ------
|
|
|
|
PyObject *RenderData_GaussFilterSize( BPy_RenderData * self, PyObject * args )
|
2004-03-14 02:06:57 +00:00
|
|
|
{
|
2004-09-25 20:30:40 +00:00
|
|
|
return M_Render_GetSetAttributeFloat( args,
|
|
|
|
&self->renderContext->gauss,
|
|
|
|
0.5f, 1.5f );
|
2004-03-14 02:06:57 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------RenderData.StartFrame() -----------
|
|
|
|
PyObject *RenderData_StartFrame( BPy_RenderData * self, PyObject * args )
|
2004-03-14 02:06:57 +00:00
|
|
|
{
|
2004-09-25 20:30:40 +00:00
|
|
|
return M_Render_GetSetAttributeShort( args, &self->renderContext->sfra,
|
|
|
|
1, 18000 );
|
2004-03-14 02:06:57 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------RenderData.CurrentFrame() ---------
|
|
|
|
PyObject *RenderData_CurrentFrame( BPy_RenderData * self, PyObject * args )
|
2004-03-14 02:06:57 +00:00
|
|
|
{
|
2004-09-25 20:30:40 +00:00
|
|
|
return M_Render_GetSetAttributeShort( args, &self->renderContext->cfra,
|
|
|
|
1, 18000 );
|
2004-03-14 02:06:57 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------RenderData.EndFrame() -------------
|
|
|
|
PyObject *RenderData_EndFrame( BPy_RenderData * self, PyObject * args )
|
2004-03-14 02:06:57 +00:00
|
|
|
{
|
2004-09-25 20:30:40 +00:00
|
|
|
return M_Render_GetSetAttributeShort( args, &self->renderContext->efra,
|
|
|
|
1, 18000 );
|
2004-03-14 02:06:57 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------RenderData.ImageSizeX() ----------
|
|
|
|
PyObject *RenderData_ImageSizeX( BPy_RenderData * self, PyObject * args )
|
2004-03-14 02:06:57 +00:00
|
|
|
{
|
2004-09-25 20:30:40 +00:00
|
|
|
return M_Render_GetSetAttributeShort( args, &self->renderContext->xsch,
|
|
|
|
4, 10000 );
|
2004-03-14 02:06:57 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------RenderData.ImageSizeY() -----------
|
|
|
|
PyObject *RenderData_ImageSizeY( BPy_RenderData * self, PyObject * args )
|
2004-03-14 02:06:57 +00:00
|
|
|
{
|
2004-09-25 20:30:40 +00:00
|
|
|
return M_Render_GetSetAttributeShort( args, &self->renderContext->ysch,
|
|
|
|
4, 10000 );
|
2004-03-14 02:06:57 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------RenderData.AspectRatioX() ---------
|
|
|
|
PyObject *RenderData_AspectRatioX( BPy_RenderData * self, PyObject * args )
|
2004-03-14 02:06:57 +00:00
|
|
|
{
|
2004-09-25 20:30:40 +00:00
|
|
|
return M_Render_GetSetAttributeShort( args, &self->renderContext->xasp,
|
|
|
|
1, 200 );
|
2004-03-14 02:06:57 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------RenderData.AspectRatioY() ---------
|
|
|
|
PyObject *RenderData_AspectRatioY( BPy_RenderData * self, PyObject * args )
|
2004-04-25 05:18:43 +00:00
|
|
|
{
|
2004-09-25 20:30:40 +00:00
|
|
|
return M_Render_GetSetAttributeShort( args, &self->renderContext->yasp,
|
|
|
|
1, 200 );
|
2004-04-25 05:18:43 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------RenderData.SetRenderer() ----------
|
|
|
|
PyObject *RenderData_SetRenderer( BPy_RenderData * self, PyObject * args )
|
2004-03-14 02:06:57 +00:00
|
|
|
{
|
|
|
|
int type;
|
|
|
|
|
2004-09-25 20:30:40 +00:00
|
|
|
if( !PyArg_ParseTuple( args, "i", &type ) )
|
|
|
|
return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
|
|
|
|
"expected constant INTERN or YAFRAY" ) );
|
2004-03-14 02:06:57 +00:00
|
|
|
|
2004-09-25 20:30:40 +00:00
|
|
|
if( type == R_INTERN )
|
2004-04-25 05:18:43 +00:00
|
|
|
self->renderContext->renderer = R_INTERN;
|
2004-09-25 20:30:40 +00:00
|
|
|
else if( type == R_YAFRAY )
|
2004-04-25 05:18:43 +00:00
|
|
|
self->renderContext->renderer = R_YAFRAY;
|
2004-03-14 02:06:57 +00:00
|
|
|
else
|
2004-09-25 20:30:40 +00:00
|
|
|
return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
|
|
|
|
"expected INTERN or YAFRAY" ) );
|
2004-03-14 02:06:57 +00:00
|
|
|
|
BPython:
- Scripts:
fixed error in "Save Current Theme" which prevented it from automatically updating script registration in menus.
cosmetic changes in a couple of Campbell's sel_same.py script strings + more descriptive name for its new menu place (3d view, face mode -> select menu).
small updates to help_browser.py script.
The above changes are related to this:
- Added new script menu entries: Render (for exporters to renderers), Themes, FaceSelect (this already at the proper place). Updated Scripts win->Scripts menu so it won't show all available entries, only the ones we mean to see there.
- Updated menu registration so that scripts folders can become trees. The release/scripts/ dir should be updated soon with subdirs like converters/, modifiers/, generators/ or whatever -- better discuss first (or is it? /me afraid of long irc discussions during meetings :) ).
- Modules:
Blender: added 'udatadir' option to .Get() function and added var Blender.mode to tell if Blender is in bg or interactive mode.
NMesh: added Campbell's nmesh.transform(matrix, recalc_normals = False) method (reworked, so my fault if it doesn't work).
- Bugs fixed:
#2123: http://projects.blender.org/tracker/?func=detail&atid=125&aid=2123&group_id=9
Reported by Ken Hughes (thanks!), who also found the exact problem later (it was in Text.Load, not with script links -- if only I had checked emails these days ... lost > 1 hour today to find the problem: passed filename to M_Text_Load was later being written over by a function called by add_text). Also saw that Text.Load wasn't checking existence of passed filename (duh!), now it does.
#1655: http://projects.blender.org/tracker/?func=detail&atid=125&aid=1655&group_id=9
Reported by Chris Want (thanks!): command line "blender -P script" not working properly for bg mode ("blender -b blendfile -P script").
Had to make some small updates to get it working (bg mode for scripts was never explicitely handled, it worked due to collateral effects, let's say), interested readers can check the report after I update it or the API_intro.py doc file. After more testing we can make further updates. Updated many places to not call redraws if in bg mode, now it is officially available. Blender outputs its own info when rendering in bg mode, if that is considered a nuissance we'll have to add a few "if (during_script())" calls outside bpython.
- Removed a few warnings here and there and also updated docs.
2005-03-19 06:24:55 +00:00
|
|
|
EXPP_allqueue( REDRAWBUTSSCENE, 0 );
|
2004-09-25 20:30:40 +00:00
|
|
|
return EXPP_incr_ret( Py_None );
|
2004-03-14 02:06:57 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------RenderData.EnableCropping() -------
|
|
|
|
PyObject *RenderData_EnableCropping( BPy_RenderData * self, PyObject * args )
|
2004-03-14 02:06:57 +00:00
|
|
|
{
|
2004-09-25 20:30:40 +00:00
|
|
|
return M_Render_BitToggleInt( args, R_MOVIECROP,
|
|
|
|
&self->renderContext->mode );
|
2004-03-14 02:06:57 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------RenderData.SetImageType() ---------
|
|
|
|
PyObject *RenderData_SetImageType( BPy_RenderData * self, PyObject * args )
|
2004-03-14 02:06:57 +00:00
|
|
|
{
|
|
|
|
int type;
|
|
|
|
|
2004-09-25 20:30:40 +00:00
|
|
|
if( !PyArg_ParseTuple( args, "i", &type ) )
|
|
|
|
return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
|
|
|
|
"expected constant" ) );
|
2004-03-14 02:06:57 +00:00
|
|
|
|
2004-09-25 20:30:40 +00:00
|
|
|
if( type == R_AVIRAW )
|
2004-04-25 05:18:43 +00:00
|
|
|
self->renderContext->imtype = R_AVIRAW;
|
2004-09-25 20:30:40 +00:00
|
|
|
else if( type == R_AVIJPEG )
|
2004-04-25 05:18:43 +00:00
|
|
|
self->renderContext->imtype = R_AVIJPEG;
|
2004-03-14 02:06:57 +00:00
|
|
|
#ifdef _WIN32
|
2004-09-25 20:30:40 +00:00
|
|
|
else if( type == R_AVICODEC )
|
2004-04-25 05:18:43 +00:00
|
|
|
self->renderContext->imtype = R_AVICODEC;
|
2004-03-14 02:06:57 +00:00
|
|
|
#endif
|
2004-09-25 20:30:40 +00:00
|
|
|
else if( type == R_QUICKTIME && G.have_quicktime )
|
2004-04-25 05:18:43 +00:00
|
|
|
self->renderContext->imtype = R_QUICKTIME;
|
2004-09-25 20:30:40 +00:00
|
|
|
else if( type == R_TARGA )
|
2004-04-25 05:18:43 +00:00
|
|
|
self->renderContext->imtype = R_TARGA;
|
2004-09-25 20:30:40 +00:00
|
|
|
else if( type == R_RAWTGA )
|
2004-04-25 05:18:43 +00:00
|
|
|
self->renderContext->imtype = R_RAWTGA;
|
2004-09-25 20:30:40 +00:00
|
|
|
else if( type == R_PNG )
|
2004-04-25 05:18:43 +00:00
|
|
|
self->renderContext->imtype = R_PNG;
|
2004-09-25 20:30:40 +00:00
|
|
|
else if( type == R_BMP )
|
2004-04-25 05:18:43 +00:00
|
|
|
self->renderContext->imtype = R_BMP;
|
2004-09-25 20:30:40 +00:00
|
|
|
else if( type == R_JPEG90 )
|
2004-04-25 05:18:43 +00:00
|
|
|
self->renderContext->imtype = R_JPEG90;
|
2004-09-25 20:30:40 +00:00
|
|
|
else if( type == R_HAMX )
|
2004-04-25 05:18:43 +00:00
|
|
|
self->renderContext->imtype = R_HAMX;
|
2004-09-25 20:30:40 +00:00
|
|
|
else if( type == R_IRIS )
|
2004-04-25 05:18:43 +00:00
|
|
|
self->renderContext->imtype = R_IRIS;
|
2004-09-25 20:30:40 +00:00
|
|
|
else if( type == R_IRIZ )
|
2004-04-25 05:18:43 +00:00
|
|
|
self->renderContext->imtype = R_IRIZ;
|
2004-09-25 20:30:40 +00:00
|
|
|
else if( type == R_FTYPE )
|
2004-04-25 05:18:43 +00:00
|
|
|
self->renderContext->imtype = R_FTYPE;
|
2004-03-14 02:06:57 +00:00
|
|
|
else
|
2004-09-25 20:30:40 +00:00
|
|
|
return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
|
|
|
|
"unknown constant - see modules dict for help" ) );
|
2004-03-14 02:06:57 +00:00
|
|
|
|
BPython:
- Scripts:
fixed error in "Save Current Theme" which prevented it from automatically updating script registration in menus.
cosmetic changes in a couple of Campbell's sel_same.py script strings + more descriptive name for its new menu place (3d view, face mode -> select menu).
small updates to help_browser.py script.
The above changes are related to this:
- Added new script menu entries: Render (for exporters to renderers), Themes, FaceSelect (this already at the proper place). Updated Scripts win->Scripts menu so it won't show all available entries, only the ones we mean to see there.
- Updated menu registration so that scripts folders can become trees. The release/scripts/ dir should be updated soon with subdirs like converters/, modifiers/, generators/ or whatever -- better discuss first (or is it? /me afraid of long irc discussions during meetings :) ).
- Modules:
Blender: added 'udatadir' option to .Get() function and added var Blender.mode to tell if Blender is in bg or interactive mode.
NMesh: added Campbell's nmesh.transform(matrix, recalc_normals = False) method (reworked, so my fault if it doesn't work).
- Bugs fixed:
#2123: http://projects.blender.org/tracker/?func=detail&atid=125&aid=2123&group_id=9
Reported by Ken Hughes (thanks!), who also found the exact problem later (it was in Text.Load, not with script links -- if only I had checked emails these days ... lost > 1 hour today to find the problem: passed filename to M_Text_Load was later being written over by a function called by add_text). Also saw that Text.Load wasn't checking existence of passed filename (duh!), now it does.
#1655: http://projects.blender.org/tracker/?func=detail&atid=125&aid=1655&group_id=9
Reported by Chris Want (thanks!): command line "blender -P script" not working properly for bg mode ("blender -b blendfile -P script").
Had to make some small updates to get it working (bg mode for scripts was never explicitely handled, it worked due to collateral effects, let's say), interested readers can check the report after I update it or the API_intro.py doc file. After more testing we can make further updates. Updated many places to not call redraws if in bg mode, now it is officially available. Blender outputs its own info when rendering in bg mode, if that is considered a nuissance we'll have to add a few "if (during_script())" calls outside bpython.
- Removed a few warnings here and there and also updated docs.
2005-03-19 06:24:55 +00:00
|
|
|
EXPP_allqueue( REDRAWBUTSSCENE, 0 );
|
2004-09-25 20:30:40 +00:00
|
|
|
return EXPP_incr_ret( Py_None );
|
2004-03-14 02:06:57 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------RenderData.Quality() --------------
|
|
|
|
PyObject *RenderData_Quality( BPy_RenderData * self, PyObject * args )
|
2004-03-14 02:06:57 +00:00
|
|
|
{
|
2004-09-25 20:30:40 +00:00
|
|
|
return M_Render_GetSetAttributeShort( args,
|
|
|
|
&self->renderContext->quality,
|
|
|
|
10, 100 );
|
2004-03-14 02:06:57 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------RenderData.FramesPerSec() ---------
|
|
|
|
PyObject *RenderData_FramesPerSec( BPy_RenderData * self, PyObject * args )
|
2004-03-14 02:06:57 +00:00
|
|
|
{
|
2004-09-25 20:30:40 +00:00
|
|
|
return M_Render_GetSetAttributeShort( args,
|
|
|
|
&self->renderContext->frs_sec, 1,
|
|
|
|
120 );
|
2004-03-14 02:06:57 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------RenderData.EnableGrayscale() ------
|
|
|
|
PyObject *RenderData_EnableGrayscale( BPy_RenderData * self )
|
2004-03-14 02:06:57 +00:00
|
|
|
{
|
2004-04-25 05:18:43 +00:00
|
|
|
self->renderContext->planes = R_PLANESBW;
|
BPython:
- Scripts:
fixed error in "Save Current Theme" which prevented it from automatically updating script registration in menus.
cosmetic changes in a couple of Campbell's sel_same.py script strings + more descriptive name for its new menu place (3d view, face mode -> select menu).
small updates to help_browser.py script.
The above changes are related to this:
- Added new script menu entries: Render (for exporters to renderers), Themes, FaceSelect (this already at the proper place). Updated Scripts win->Scripts menu so it won't show all available entries, only the ones we mean to see there.
- Updated menu registration so that scripts folders can become trees. The release/scripts/ dir should be updated soon with subdirs like converters/, modifiers/, generators/ or whatever -- better discuss first (or is it? /me afraid of long irc discussions during meetings :) ).
- Modules:
Blender: added 'udatadir' option to .Get() function and added var Blender.mode to tell if Blender is in bg or interactive mode.
NMesh: added Campbell's nmesh.transform(matrix, recalc_normals = False) method (reworked, so my fault if it doesn't work).
- Bugs fixed:
#2123: http://projects.blender.org/tracker/?func=detail&atid=125&aid=2123&group_id=9
Reported by Ken Hughes (thanks!), who also found the exact problem later (it was in Text.Load, not with script links -- if only I had checked emails these days ... lost > 1 hour today to find the problem: passed filename to M_Text_Load was later being written over by a function called by add_text). Also saw that Text.Load wasn't checking existence of passed filename (duh!), now it does.
#1655: http://projects.blender.org/tracker/?func=detail&atid=125&aid=1655&group_id=9
Reported by Chris Want (thanks!): command line "blender -P script" not working properly for bg mode ("blender -b blendfile -P script").
Had to make some small updates to get it working (bg mode for scripts was never explicitely handled, it worked due to collateral effects, let's say), interested readers can check the report after I update it or the API_intro.py doc file. After more testing we can make further updates. Updated many places to not call redraws if in bg mode, now it is officially available. Blender outputs its own info when rendering in bg mode, if that is considered a nuissance we'll have to add a few "if (during_script())" calls outside bpython.
- Removed a few warnings here and there and also updated docs.
2005-03-19 06:24:55 +00:00
|
|
|
EXPP_allqueue( REDRAWBUTSSCENE, 0 );
|
2004-03-14 02:06:57 +00:00
|
|
|
|
2004-09-25 20:30:40 +00:00
|
|
|
return EXPP_incr_ret( Py_None );
|
2004-03-14 02:06:57 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------RenderData.EnableRGBColor() -------
|
|
|
|
PyObject *RenderData_EnableRGBColor( BPy_RenderData * self )
|
2004-03-14 02:06:57 +00:00
|
|
|
{
|
2004-04-25 05:18:43 +00:00
|
|
|
self->renderContext->planes = R_PLANES24;
|
BPython:
- Scripts:
fixed error in "Save Current Theme" which prevented it from automatically updating script registration in menus.
cosmetic changes in a couple of Campbell's sel_same.py script strings + more descriptive name for its new menu place (3d view, face mode -> select menu).
small updates to help_browser.py script.
The above changes are related to this:
- Added new script menu entries: Render (for exporters to renderers), Themes, FaceSelect (this already at the proper place). Updated Scripts win->Scripts menu so it won't show all available entries, only the ones we mean to see there.
- Updated menu registration so that scripts folders can become trees. The release/scripts/ dir should be updated soon with subdirs like converters/, modifiers/, generators/ or whatever -- better discuss first (or is it? /me afraid of long irc discussions during meetings :) ).
- Modules:
Blender: added 'udatadir' option to .Get() function and added var Blender.mode to tell if Blender is in bg or interactive mode.
NMesh: added Campbell's nmesh.transform(matrix, recalc_normals = False) method (reworked, so my fault if it doesn't work).
- Bugs fixed:
#2123: http://projects.blender.org/tracker/?func=detail&atid=125&aid=2123&group_id=9
Reported by Ken Hughes (thanks!), who also found the exact problem later (it was in Text.Load, not with script links -- if only I had checked emails these days ... lost > 1 hour today to find the problem: passed filename to M_Text_Load was later being written over by a function called by add_text). Also saw that Text.Load wasn't checking existence of passed filename (duh!), now it does.
#1655: http://projects.blender.org/tracker/?func=detail&atid=125&aid=1655&group_id=9
Reported by Chris Want (thanks!): command line "blender -P script" not working properly for bg mode ("blender -b blendfile -P script").
Had to make some small updates to get it working (bg mode for scripts was never explicitely handled, it worked due to collateral effects, let's say), interested readers can check the report after I update it or the API_intro.py doc file. After more testing we can make further updates. Updated many places to not call redraws if in bg mode, now it is officially available. Blender outputs its own info when rendering in bg mode, if that is considered a nuissance we'll have to add a few "if (during_script())" calls outside bpython.
- Removed a few warnings here and there and also updated docs.
2005-03-19 06:24:55 +00:00
|
|
|
EXPP_allqueue( REDRAWBUTSSCENE, 0 );
|
2004-03-14 02:06:57 +00:00
|
|
|
|
2004-09-25 20:30:40 +00:00
|
|
|
return EXPP_incr_ret( Py_None );
|
2004-03-14 02:06:57 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------RenderData.EnableRGBAColor() ------
|
|
|
|
PyObject *RenderData_EnableRGBAColor( BPy_RenderData * self )
|
2004-03-14 02:06:57 +00:00
|
|
|
{
|
2004-04-25 05:18:43 +00:00
|
|
|
self->renderContext->planes = R_PLANES32;
|
BPython:
- Scripts:
fixed error in "Save Current Theme" which prevented it from automatically updating script registration in menus.
cosmetic changes in a couple of Campbell's sel_same.py script strings + more descriptive name for its new menu place (3d view, face mode -> select menu).
small updates to help_browser.py script.
The above changes are related to this:
- Added new script menu entries: Render (for exporters to renderers), Themes, FaceSelect (this already at the proper place). Updated Scripts win->Scripts menu so it won't show all available entries, only the ones we mean to see there.
- Updated menu registration so that scripts folders can become trees. The release/scripts/ dir should be updated soon with subdirs like converters/, modifiers/, generators/ or whatever -- better discuss first (or is it? /me afraid of long irc discussions during meetings :) ).
- Modules:
Blender: added 'udatadir' option to .Get() function and added var Blender.mode to tell if Blender is in bg or interactive mode.
NMesh: added Campbell's nmesh.transform(matrix, recalc_normals = False) method (reworked, so my fault if it doesn't work).
- Bugs fixed:
#2123: http://projects.blender.org/tracker/?func=detail&atid=125&aid=2123&group_id=9
Reported by Ken Hughes (thanks!), who also found the exact problem later (it was in Text.Load, not with script links -- if only I had checked emails these days ... lost > 1 hour today to find the problem: passed filename to M_Text_Load was later being written over by a function called by add_text). Also saw that Text.Load wasn't checking existence of passed filename (duh!), now it does.
#1655: http://projects.blender.org/tracker/?func=detail&atid=125&aid=1655&group_id=9
Reported by Chris Want (thanks!): command line "blender -P script" not working properly for bg mode ("blender -b blendfile -P script").
Had to make some small updates to get it working (bg mode for scripts was never explicitely handled, it worked due to collateral effects, let's say), interested readers can check the report after I update it or the API_intro.py doc file. After more testing we can make further updates. Updated many places to not call redraws if in bg mode, now it is officially available. Blender outputs its own info when rendering in bg mode, if that is considered a nuissance we'll have to add a few "if (during_script())" calls outside bpython.
- Removed a few warnings here and there and also updated docs.
2005-03-19 06:24:55 +00:00
|
|
|
EXPP_allqueue( REDRAWBUTSSCENE, 0 );
|
2004-03-14 02:06:57 +00:00
|
|
|
|
2004-09-25 20:30:40 +00:00
|
|
|
return EXPP_incr_ret( Py_None );
|
2004-03-14 02:06:57 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------RenderData.SizePreset() -----------
|
|
|
|
PyObject *RenderData_SizePreset( BPy_RenderData * self, PyObject * args )
|
2004-03-14 02:06:57 +00:00
|
|
|
{
|
|
|
|
int type;
|
|
|
|
|
2004-09-25 20:30:40 +00:00
|
|
|
if( !PyArg_ParseTuple( args, "i", &type ) )
|
|
|
|
return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
|
|
|
|
"expected constant" ) );
|
2004-03-14 02:06:57 +00:00
|
|
|
|
2004-09-25 20:30:40 +00:00
|
|
|
if( type == B_PR_PAL ) {
|
|
|
|
M_Render_DoSizePreset( self, 720, 576, 54, 51, 100,
|
|
|
|
self->renderContext->xparts,
|
|
|
|
self->renderContext->yparts, 25, 0.1,
|
|
|
|
0.9, 0.1, 0.9 );
|
2004-04-25 05:18:43 +00:00
|
|
|
self->renderContext->mode &= ~R_PANORAMA;
|
2004-09-25 20:30:40 +00:00
|
|
|
BLI_init_rctf( &self->renderContext->safety, 0.1, 0.9, 0.1,
|
|
|
|
0.9 );
|
|
|
|
} else if( type == B_PR_NTSC ) {
|
|
|
|
M_Render_DoSizePreset( self, 720, 480, 10, 11, 100, 1, 1,
|
|
|
|
30, 0.1, 0.9, 0.1, 0.9 );
|
2004-04-25 05:18:43 +00:00
|
|
|
self->renderContext->mode &= ~R_PANORAMA;
|
2004-09-25 20:30:40 +00:00
|
|
|
BLI_init_rctf( &self->renderContext->safety, 0.1, 0.9, 0.1,
|
|
|
|
0.9 );
|
|
|
|
} else if( type == B_PR_PRESET ) {
|
|
|
|
M_Render_DoSizePreset( self, 720, 576, 54, 51, 100, 1, 1,
|
|
|
|
self->renderContext->frs_sec, 0.1, 0.9,
|
|
|
|
0.1, 0.9 );
|
|
|
|
self->renderContext->mode = R_OSA + R_SHADOW + R_FIELDS;
|
|
|
|
self->renderContext->imtype = R_TARGA;
|
|
|
|
BLI_init_rctf( &self->renderContext->safety, 0.1, 0.9, 0.1,
|
|
|
|
0.9 );
|
|
|
|
} else if( type == B_PR_PRV ) {
|
|
|
|
M_Render_DoSizePreset( self, 640, 512, 1, 1, 50, 1, 1,
|
|
|
|
self->renderContext->frs_sec, 0.1, 0.9,
|
|
|
|
0.1, 0.9 );
|
2004-04-25 05:18:43 +00:00
|
|
|
self->renderContext->mode &= ~R_PANORAMA;
|
2004-09-25 20:30:40 +00:00
|
|
|
BLI_init_rctf( &self->renderContext->safety, 0.1, 0.9, 0.1,
|
|
|
|
0.9 );
|
|
|
|
} else if( type == B_PR_PC ) {
|
|
|
|
M_Render_DoSizePreset( self, 640, 480, 100, 100, 100, 1, 1,
|
|
|
|
self->renderContext->frs_sec, 0.0, 1.0,
|
|
|
|
0.0, 1.0 );
|
2004-04-25 05:18:43 +00:00
|
|
|
self->renderContext->mode &= ~R_PANORAMA;
|
2004-09-25 20:30:40 +00:00
|
|
|
BLI_init_rctf( &self->renderContext->safety, 0.0, 1.0, 0.0,
|
|
|
|
1.0 );
|
|
|
|
} else if( type == B_PR_PAL169 ) {
|
|
|
|
M_Render_DoSizePreset( self, 720, 576, 64, 45, 100, 1, 1,
|
|
|
|
25, 0.1, 0.9, 0.1, 0.9 );
|
2004-04-25 05:18:43 +00:00
|
|
|
self->renderContext->mode &= ~R_PANORAMA;
|
2004-09-25 20:30:40 +00:00
|
|
|
BLI_init_rctf( &self->renderContext->safety, 0.1, 0.9, 0.1,
|
|
|
|
0.9 );
|
|
|
|
} else if( type == B_PR_PANO ) {
|
|
|
|
M_Render_DoSizePreset( self, 36, 176, 115, 100, 100, 16, 1,
|
|
|
|
self->renderContext->frs_sec, 0.1, 0.9,
|
|
|
|
0.1, 0.9 );
|
2004-04-25 05:18:43 +00:00
|
|
|
self->renderContext->mode |= R_PANORAMA;
|
2004-09-25 20:30:40 +00:00
|
|
|
BLI_init_rctf( &self->renderContext->safety, 0.1, 0.9, 0.1,
|
|
|
|
0.9 );
|
|
|
|
} else if( type == B_PR_FULL ) {
|
|
|
|
M_Render_DoSizePreset( self, 1280, 1024, 1, 1, 100, 1, 1,
|
|
|
|
self->renderContext->frs_sec, 0.1, 0.9,
|
|
|
|
0.1, 0.9 );
|
2004-04-25 05:18:43 +00:00
|
|
|
self->renderContext->mode &= ~R_PANORAMA;
|
2004-09-25 20:30:40 +00:00
|
|
|
BLI_init_rctf( &self->renderContext->safety, 0.1, 0.9, 0.1,
|
|
|
|
0.9 );
|
|
|
|
} else
|
|
|
|
return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
|
|
|
|
"unknown constant - see modules dict for help" ) );
|
2004-03-14 02:06:57 +00:00
|
|
|
|
BPython:
- Scripts:
fixed error in "Save Current Theme" which prevented it from automatically updating script registration in menus.
cosmetic changes in a couple of Campbell's sel_same.py script strings + more descriptive name for its new menu place (3d view, face mode -> select menu).
small updates to help_browser.py script.
The above changes are related to this:
- Added new script menu entries: Render (for exporters to renderers), Themes, FaceSelect (this already at the proper place). Updated Scripts win->Scripts menu so it won't show all available entries, only the ones we mean to see there.
- Updated menu registration so that scripts folders can become trees. The release/scripts/ dir should be updated soon with subdirs like converters/, modifiers/, generators/ or whatever -- better discuss first (or is it? /me afraid of long irc discussions during meetings :) ).
- Modules:
Blender: added 'udatadir' option to .Get() function and added var Blender.mode to tell if Blender is in bg or interactive mode.
NMesh: added Campbell's nmesh.transform(matrix, recalc_normals = False) method (reworked, so my fault if it doesn't work).
- Bugs fixed:
#2123: http://projects.blender.org/tracker/?func=detail&atid=125&aid=2123&group_id=9
Reported by Ken Hughes (thanks!), who also found the exact problem later (it was in Text.Load, not with script links -- if only I had checked emails these days ... lost > 1 hour today to find the problem: passed filename to M_Text_Load was later being written over by a function called by add_text). Also saw that Text.Load wasn't checking existence of passed filename (duh!), now it does.
#1655: http://projects.blender.org/tracker/?func=detail&atid=125&aid=1655&group_id=9
Reported by Chris Want (thanks!): command line "blender -P script" not working properly for bg mode ("blender -b blendfile -P script").
Had to make some small updates to get it working (bg mode for scripts was never explicitely handled, it worked due to collateral effects, let's say), interested readers can check the report after I update it or the API_intro.py doc file. After more testing we can make further updates. Updated many places to not call redraws if in bg mode, now it is officially available. Blender outputs its own info when rendering in bg mode, if that is considered a nuissance we'll have to add a few "if (during_script())" calls outside bpython.
- Removed a few warnings here and there and also updated docs.
2005-03-19 06:24:55 +00:00
|
|
|
EXPP_allqueue( REDRAWBUTSSCENE, 0 );
|
2004-09-25 20:30:40 +00:00
|
|
|
return EXPP_incr_ret( Py_None );
|
2004-03-14 02:06:57 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------RenderData.EnableUnifiedRenderer()
|
|
|
|
PyObject *RenderData_EnableUnifiedRenderer( BPy_RenderData * self,
|
|
|
|
PyObject * args )
|
2004-03-14 02:06:57 +00:00
|
|
|
{
|
2004-09-25 20:30:40 +00:00
|
|
|
return M_Render_BitToggleInt( args, R_UNIFIED,
|
|
|
|
&self->renderContext->mode );
|
2004-03-14 02:06:57 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------RenderData.SetYafrayGIQuality() ---
|
|
|
|
PyObject *RenderData_SetYafrayGIQuality( BPy_RenderData * self,
|
|
|
|
PyObject * args )
|
2004-03-14 02:06:57 +00:00
|
|
|
{
|
|
|
|
int type;
|
|
|
|
|
2004-09-25 20:30:40 +00:00
|
|
|
if( !PyArg_ParseTuple( args, "i", &type ) )
|
|
|
|
return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
|
|
|
|
"expected constant" ) );
|
2004-03-14 02:06:57 +00:00
|
|
|
|
2004-09-25 20:30:40 +00:00
|
|
|
if( type == PY_NONE || type == PY_LOW ||
|
|
|
|
type == PY_MEDIUM || type == PY_HIGH ||
|
|
|
|
type == PY_HIGHER || type == PY_BEST ) {
|
2004-04-25 05:18:43 +00:00
|
|
|
self->renderContext->GIquality = type;
|
2004-09-25 20:30:40 +00:00
|
|
|
} else
|
|
|
|
return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
|
|
|
|
"unknown constant - see modules dict for help" ) );
|
2004-03-14 02:06:57 +00:00
|
|
|
|
BPython:
- Scripts:
fixed error in "Save Current Theme" which prevented it from automatically updating script registration in menus.
cosmetic changes in a couple of Campbell's sel_same.py script strings + more descriptive name for its new menu place (3d view, face mode -> select menu).
small updates to help_browser.py script.
The above changes are related to this:
- Added new script menu entries: Render (for exporters to renderers), Themes, FaceSelect (this already at the proper place). Updated Scripts win->Scripts menu so it won't show all available entries, only the ones we mean to see there.
- Updated menu registration so that scripts folders can become trees. The release/scripts/ dir should be updated soon with subdirs like converters/, modifiers/, generators/ or whatever -- better discuss first (or is it? /me afraid of long irc discussions during meetings :) ).
- Modules:
Blender: added 'udatadir' option to .Get() function and added var Blender.mode to tell if Blender is in bg or interactive mode.
NMesh: added Campbell's nmesh.transform(matrix, recalc_normals = False) method (reworked, so my fault if it doesn't work).
- Bugs fixed:
#2123: http://projects.blender.org/tracker/?func=detail&atid=125&aid=2123&group_id=9
Reported by Ken Hughes (thanks!), who also found the exact problem later (it was in Text.Load, not with script links -- if only I had checked emails these days ... lost > 1 hour today to find the problem: passed filename to M_Text_Load was later being written over by a function called by add_text). Also saw that Text.Load wasn't checking existence of passed filename (duh!), now it does.
#1655: http://projects.blender.org/tracker/?func=detail&atid=125&aid=1655&group_id=9
Reported by Chris Want (thanks!): command line "blender -P script" not working properly for bg mode ("blender -b blendfile -P script").
Had to make some small updates to get it working (bg mode for scripts was never explicitely handled, it worked due to collateral effects, let's say), interested readers can check the report after I update it or the API_intro.py doc file. After more testing we can make further updates. Updated many places to not call redraws if in bg mode, now it is officially available. Blender outputs its own info when rendering in bg mode, if that is considered a nuissance we'll have to add a few "if (during_script())" calls outside bpython.
- Removed a few warnings here and there and also updated docs.
2005-03-19 06:24:55 +00:00
|
|
|
EXPP_allqueue( REDRAWBUTSSCENE, 0 );
|
2004-09-25 20:30:40 +00:00
|
|
|
return EXPP_incr_ret( Py_None );
|
2004-03-14 02:06:57 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------RenderData.SetYafrayGIMethod() ----
|
|
|
|
PyObject *RenderData_SetYafrayGIMethod( BPy_RenderData * self,
|
|
|
|
PyObject * args )
|
2004-03-14 02:06:57 +00:00
|
|
|
{
|
|
|
|
int type;
|
|
|
|
|
2004-09-25 20:30:40 +00:00
|
|
|
if( !PyArg_ParseTuple( args, "i", &type ) )
|
|
|
|
return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
|
|
|
|
"expected constant" ) );
|
2004-03-14 02:06:57 +00:00
|
|
|
|
2004-09-25 20:30:40 +00:00
|
|
|
if( type == PY_NONE || type == PY_SKYDOME || type == PY_FULL ) {
|
2004-04-25 05:18:43 +00:00
|
|
|
self->renderContext->GImethod = type;
|
2004-09-25 20:30:40 +00:00
|
|
|
} else
|
|
|
|
return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
|
|
|
|
"unknown constant - see modules dict for help" ) );
|
|
|
|
|
BPython:
- Scripts:
fixed error in "Save Current Theme" which prevented it from automatically updating script registration in menus.
cosmetic changes in a couple of Campbell's sel_same.py script strings + more descriptive name for its new menu place (3d view, face mode -> select menu).
small updates to help_browser.py script.
The above changes are related to this:
- Added new script menu entries: Render (for exporters to renderers), Themes, FaceSelect (this already at the proper place). Updated Scripts win->Scripts menu so it won't show all available entries, only the ones we mean to see there.
- Updated menu registration so that scripts folders can become trees. The release/scripts/ dir should be updated soon with subdirs like converters/, modifiers/, generators/ or whatever -- better discuss first (or is it? /me afraid of long irc discussions during meetings :) ).
- Modules:
Blender: added 'udatadir' option to .Get() function and added var Blender.mode to tell if Blender is in bg or interactive mode.
NMesh: added Campbell's nmesh.transform(matrix, recalc_normals = False) method (reworked, so my fault if it doesn't work).
- Bugs fixed:
#2123: http://projects.blender.org/tracker/?func=detail&atid=125&aid=2123&group_id=9
Reported by Ken Hughes (thanks!), who also found the exact problem later (it was in Text.Load, not with script links -- if only I had checked emails these days ... lost > 1 hour today to find the problem: passed filename to M_Text_Load was later being written over by a function called by add_text). Also saw that Text.Load wasn't checking existence of passed filename (duh!), now it does.
#1655: http://projects.blender.org/tracker/?func=detail&atid=125&aid=1655&group_id=9
Reported by Chris Want (thanks!): command line "blender -P script" not working properly for bg mode ("blender -b blendfile -P script").
Had to make some small updates to get it working (bg mode for scripts was never explicitely handled, it worked due to collateral effects, let's say), interested readers can check the report after I update it or the API_intro.py doc file. After more testing we can make further updates. Updated many places to not call redraws if in bg mode, now it is officially available. Blender outputs its own info when rendering in bg mode, if that is considered a nuissance we'll have to add a few "if (during_script())" calls outside bpython.
- Removed a few warnings here and there and also updated docs.
2005-03-19 06:24:55 +00:00
|
|
|
EXPP_allqueue( REDRAWBUTSSCENE, 0 );
|
2004-09-25 20:30:40 +00:00
|
|
|
return EXPP_incr_ret( Py_None );
|
|
|
|
}
|
|
|
|
|
|
|
|
//------------------------------------RenderData.YafrayGIPower() --------
|
|
|
|
PyObject *RenderData_YafrayGIPower( BPy_RenderData * self, PyObject * args )
|
|
|
|
{
|
|
|
|
if( self->renderContext->GImethod > 0 ) {
|
|
|
|
return M_Render_GetSetAttributeFloat( args,
|
|
|
|
&self->renderContext->
|
|
|
|
GIpower, 0.01f,
|
|
|
|
100.00f );
|
|
|
|
} else
|
|
|
|
return ( EXPP_ReturnPyObjError( PyExc_StandardError,
|
|
|
|
"YafrayGIMethod must be set to 'SKYDOME' or 'FULL'" ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
//------------------------------------RenderData.YafrayGIDepth() --------
|
|
|
|
PyObject *RenderData_YafrayGIDepth( BPy_RenderData * self, PyObject * args )
|
|
|
|
{
|
|
|
|
if( self->renderContext->GImethod == 2 ) {
|
|
|
|
return M_Render_GetSetAttributeInt( args,
|
|
|
|
&self->renderContext->
|
|
|
|
GIdepth, 1, 8 );
|
|
|
|
} else
|
|
|
|
return ( EXPP_ReturnPyObjError( PyExc_StandardError,
|
|
|
|
"YafrayGIMethod must be set to 'FULL'" ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
//------------------------------------RenderData.afrayGICDepth() --------
|
|
|
|
PyObject *RenderData_YafrayGICDepth( BPy_RenderData * self, PyObject * args )
|
|
|
|
{
|
|
|
|
if( self->renderContext->GImethod == 2 ) {
|
|
|
|
return M_Render_GetSetAttributeInt( args,
|
|
|
|
&self->renderContext->
|
|
|
|
GIcausdepth, 1, 8 );
|
|
|
|
} else
|
|
|
|
return ( EXPP_ReturnPyObjError( PyExc_StandardError,
|
|
|
|
"YafrayGIMethod must be set to 'FULL'" ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
//------------------------------------RenderData.EnableYafrayGICache() --
|
|
|
|
PyObject *RenderData_EnableYafrayGICache( BPy_RenderData * self,
|
|
|
|
PyObject * args )
|
|
|
|
{
|
|
|
|
if( self->renderContext->GImethod == 2 ) {
|
|
|
|
return M_Render_BitToggleShort( args, 1,
|
|
|
|
&self->renderContext->
|
|
|
|
GIcache );
|
|
|
|
} else
|
|
|
|
return ( EXPP_ReturnPyObjError( PyExc_StandardError,
|
|
|
|
"YafrayGIMethod must be set to 'FULL'" ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
//------------------------------------RenderData.EnableYafrayGIPhotons()
|
|
|
|
PyObject *RenderData_EnableYafrayGIPhotons( BPy_RenderData * self,
|
|
|
|
PyObject * args )
|
|
|
|
{
|
|
|
|
if( self->renderContext->GImethod == 2 ) {
|
|
|
|
return M_Render_BitToggleShort( args, 1,
|
|
|
|
&self->renderContext->
|
|
|
|
GIphotons );;
|
|
|
|
} else
|
|
|
|
return ( EXPP_ReturnPyObjError( PyExc_StandardError,
|
|
|
|
"YafrayGIMethod must be set to 'FULL'" ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
//------------------------------------RenderData.YafrayGIPhotonCount() --
|
|
|
|
PyObject *RenderData_YafrayGIPhotonCount( BPy_RenderData * self,
|
|
|
|
PyObject * args )
|
|
|
|
{
|
|
|
|
if( self->renderContext->GImethod == 2
|
|
|
|
&& self->renderContext->GIphotons == 1 ) {
|
|
|
|
return M_Render_GetSetAttributeInt( args,
|
|
|
|
&self->renderContext->
|
|
|
|
GIphotoncount, 0,
|
|
|
|
10000000 );
|
|
|
|
} else
|
|
|
|
return ( EXPP_ReturnPyObjError( PyExc_StandardError,
|
|
|
|
"YafrayGIMethod must be set to 'FULL' and GIPhotons must be enabled\n" ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
//------------------------------------RenderData.YafrayGIPhotonRadius() -
|
|
|
|
PyObject *RenderData_YafrayGIPhotonRadius( BPy_RenderData * self,
|
|
|
|
PyObject * args )
|
|
|
|
{
|
|
|
|
if( self->renderContext->GImethod == 2
|
|
|
|
&& self->renderContext->GIphotons == 1 ) {
|
|
|
|
return M_Render_GetSetAttributeFloat( args,
|
|
|
|
&self->renderContext->
|
|
|
|
GIphotonradius, 0.00001f,
|
|
|
|
100.0f );
|
|
|
|
} else
|
|
|
|
return ( EXPP_ReturnPyObjError( PyExc_StandardError,
|
|
|
|
"YafrayGIMethod must be set to 'FULL' and GIPhotons must be enabled\n" ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
//------------------------------------RenderData.YafrayGIPhotonMixCount()
|
|
|
|
PyObject *RenderData_YafrayGIPhotonMixCount( BPy_RenderData * self,
|
|
|
|
PyObject * args )
|
|
|
|
{
|
|
|
|
if( self->renderContext->GImethod == 2
|
|
|
|
&& self->renderContext->GIphotons == 1 ) {
|
|
|
|
return M_Render_GetSetAttributeInt( args,
|
|
|
|
&self->renderContext->
|
|
|
|
GImixphotons, 0, 1000 );
|
|
|
|
} else
|
|
|
|
return ( EXPP_ReturnPyObjError( PyExc_StandardError,
|
|
|
|
"YafrayGIMethod must be set to 'FULL' and GIPhotons must be enabled\n" ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------RenderData.EnableYafrayGITunePhotons() ------
|
|
|
|
PyObject *RenderData_EnableYafrayGITunePhotons( BPy_RenderData * self,
|
|
|
|
PyObject * args )
|
2004-03-14 02:06:57 +00:00
|
|
|
{
|
2004-09-25 20:30:40 +00:00
|
|
|
if( self->renderContext->GImethod == 2
|
|
|
|
&& self->renderContext->GIphotons == 1 ) {
|
|
|
|
return M_Render_BitToggleShort( args, 1,
|
|
|
|
&self->renderContext->
|
|
|
|
GIdirect );;
|
|
|
|
} else
|
|
|
|
return ( EXPP_ReturnPyObjError( PyExc_StandardError,
|
|
|
|
"YafrayGIMethod must be set to 'FULL' and GIPhotons must be enabled" ) );
|
2004-03-14 02:06:57 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------RenderData.YafrayGIShadowQuality()
|
|
|
|
PyObject *RenderData_YafrayGIShadowQuality( BPy_RenderData * self,
|
|
|
|
PyObject * args )
|
2004-03-14 02:06:57 +00:00
|
|
|
{
|
2004-09-25 20:30:40 +00:00
|
|
|
if( self->renderContext->GImethod == 2
|
|
|
|
&& self->renderContext->GIcache == 1 ) {
|
|
|
|
return M_Render_GetSetAttributeFloat( args,
|
|
|
|
&self->renderContext->
|
|
|
|
GIshadowquality, 0.01f,
|
|
|
|
1.0f );
|
|
|
|
} else
|
|
|
|
return ( EXPP_ReturnPyObjError( PyExc_StandardError,
|
|
|
|
"YafrayGIMethod must be set to 'FULL' and GICache must be enabled\n" ) );
|
2004-03-14 02:06:57 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------RenderData.YafrayGIPixelsPerSample()
|
|
|
|
PyObject *RenderData_YafrayGIPixelsPerSample( BPy_RenderData * self,
|
|
|
|
PyObject * args )
|
2004-03-14 02:06:57 +00:00
|
|
|
{
|
2004-09-25 20:30:40 +00:00
|
|
|
if( self->renderContext->GImethod == 2
|
|
|
|
&& self->renderContext->GIcache == 1 ) {
|
|
|
|
return M_Render_GetSetAttributeInt( args,
|
|
|
|
&self->renderContext->
|
|
|
|
GIpixelspersample, 1, 50 );
|
|
|
|
} else
|
|
|
|
return ( EXPP_ReturnPyObjError( PyExc_StandardError,
|
|
|
|
"YafrayGIMethod must be set to 'FULL' and GICache must be enabled\n" ) );
|
2004-03-14 02:06:57 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------RenderData.YafrayGIRefinement() ----
|
|
|
|
PyObject *RenderData_YafrayGIRefinement( BPy_RenderData * self,
|
|
|
|
PyObject * args )
|
2004-03-14 02:06:57 +00:00
|
|
|
{
|
2004-09-25 20:30:40 +00:00
|
|
|
if( self->renderContext->GImethod == 2
|
|
|
|
&& self->renderContext->GIcache == 1 ) {
|
|
|
|
return M_Render_GetSetAttributeFloat( args,
|
|
|
|
&self->renderContext->
|
|
|
|
GIrefinement, 0.001f,
|
|
|
|
1.0f );
|
|
|
|
} else
|
|
|
|
return ( EXPP_ReturnPyObjError( PyExc_StandardError,
|
|
|
|
"YafrayGIMethod must be set to 'FULL' and GICache must be enabled\n" ) );
|
2004-03-14 02:06:57 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------RenderData.YafrayRayBias() ---------
|
|
|
|
PyObject *RenderData_YafrayRayBias( BPy_RenderData * self, PyObject * args )
|
2004-03-14 02:06:57 +00:00
|
|
|
{
|
2004-09-25 20:30:40 +00:00
|
|
|
return M_Render_GetSetAttributeFloat( args,
|
|
|
|
&self->renderContext->YF_raybias,
|
|
|
|
0.0f, 10.0f );
|
2004-03-14 02:06:57 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------RenderData.YafrayRayDepth() --------
|
|
|
|
PyObject *RenderData_YafrayRayDepth( BPy_RenderData * self, PyObject * args )
|
2004-03-14 02:06:57 +00:00
|
|
|
{
|
2004-09-25 20:30:40 +00:00
|
|
|
return M_Render_GetSetAttributeInt( args,
|
|
|
|
&self->renderContext->YF_raydepth,
|
|
|
|
1, 80 );
|
2004-03-14 02:06:57 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------RenderData.YafrayGamma() -----------
|
|
|
|
PyObject *RenderData_YafrayGamma( BPy_RenderData * self, PyObject * args )
|
2004-03-14 02:06:57 +00:00
|
|
|
{
|
2004-09-25 20:30:40 +00:00
|
|
|
return M_Render_GetSetAttributeFloat( args,
|
|
|
|
&self->renderContext->YF_gamma,
|
|
|
|
0.001f, 5.0f );
|
2004-03-14 02:06:57 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------RenderData.YafrayExposure() --------
|
|
|
|
PyObject *RenderData_YafrayExposure( BPy_RenderData * self, PyObject * args )
|
2004-03-14 02:06:57 +00:00
|
|
|
{
|
2004-09-25 20:30:40 +00:00
|
|
|
return M_Render_GetSetAttributeFloat( args,
|
|
|
|
&self->renderContext->
|
|
|
|
YF_exposure, 0.0f, 10.0f );
|
2004-03-14 02:06:57 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------RenderData.YafrayProcessorCount() --
|
|
|
|
PyObject *RenderData_YafrayProcessorCount( BPy_RenderData * self,
|
|
|
|
PyObject * args )
|
2004-03-14 02:06:57 +00:00
|
|
|
{
|
2004-09-25 20:30:40 +00:00
|
|
|
return M_Render_GetSetAttributeInt( args,
|
|
|
|
&self->renderContext->YF_numprocs,
|
|
|
|
1, 8 );
|
2004-03-14 02:06:57 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
2004-04-25 05:18:43 +00:00
|
|
|
//------------------------------------RenderData.EnableGameFrameStretch() -----------------------------------------------------------
|
2004-09-25 20:30:40 +00:00
|
|
|
PyObject *RenderData_EnableGameFrameStretch( BPy_RenderData * self )
|
2004-03-14 02:06:57 +00:00
|
|
|
{
|
2004-04-25 05:18:43 +00:00
|
|
|
self->scene->framing.type = SCE_GAMEFRAMING_SCALE;
|
2004-09-25 20:30:40 +00:00
|
|
|
return EXPP_incr_ret( Py_None );
|
2004-03-14 02:06:57 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------RenderData.EnableGameFrameExpose() -
|
|
|
|
PyObject *RenderData_EnableGameFrameExpose( BPy_RenderData * self )
|
2004-03-14 02:06:57 +00:00
|
|
|
{
|
2004-04-25 05:18:43 +00:00
|
|
|
self->scene->framing.type = SCE_GAMEFRAMING_EXTEND;
|
2004-09-25 20:30:40 +00:00
|
|
|
return EXPP_incr_ret( Py_None );
|
2004-03-14 02:06:57 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------RenderData.EnableGameFrameBars() ---
|
|
|
|
PyObject *RenderData_EnableGameFrameBars( BPy_RenderData * self )
|
2004-03-14 02:06:57 +00:00
|
|
|
{
|
2004-04-25 05:18:43 +00:00
|
|
|
self->scene->framing.type = SCE_GAMEFRAMING_BARS;
|
2004-09-25 20:30:40 +00:00
|
|
|
return EXPP_incr_ret( Py_None );
|
2004-03-14 02:06:57 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------RenderData.SetGameFrameColor() -----
|
|
|
|
PyObject *RenderData_SetGameFrameColor( BPy_RenderData * self,
|
|
|
|
PyObject * args )
|
2004-03-14 02:06:57 +00:00
|
|
|
{
|
|
|
|
float red = 0.0f;
|
|
|
|
float green = 0.0f;
|
|
|
|
float blue = 0.0f;
|
|
|
|
|
2004-09-25 20:30:40 +00:00
|
|
|
if( !PyArg_ParseTuple( args, "fff", &red, &green, &blue ) )
|
|
|
|
return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
|
|
|
|
"expected three floats" ) );
|
2004-03-14 02:06:57 +00:00
|
|
|
|
2004-09-25 20:30:40 +00:00
|
|
|
if( red < 0 || red > 1 )
|
|
|
|
return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
|
|
|
|
"value out of range 0.000 - 1.000 (red)" ) );
|
|
|
|
if( green < 0 || green > 1 )
|
|
|
|
return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
|
|
|
|
"value out of range 0.000 - 1.000 (green)" ) );
|
|
|
|
if( blue < 0 || blue > 1 )
|
|
|
|
return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
|
|
|
|
"value out of range 0.000 - 1.000 (blue)" ) );
|
2004-03-14 02:06:57 +00:00
|
|
|
|
2004-04-25 05:18:43 +00:00
|
|
|
self->scene->framing.col[0] = red;
|
|
|
|
self->scene->framing.col[1] = green;
|
|
|
|
self->scene->framing.col[2] = blue;
|
2004-03-14 02:06:57 +00:00
|
|
|
|
2004-09-25 20:30:40 +00:00
|
|
|
return EXPP_incr_ret( Py_None );
|
2004-03-14 02:06:57 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------RenderData.GetGameFrameColor() -----
|
|
|
|
PyObject *RenderData_GetGameFrameColor( BPy_RenderData * self )
|
2004-03-14 02:06:57 +00:00
|
|
|
{
|
|
|
|
char rgb[24];
|
|
|
|
|
2004-09-25 20:30:40 +00:00
|
|
|
sprintf( rgb, "[%.3f,%.3f,%.3f]\n", self->scene->framing.col[0],
|
|
|
|
self->scene->framing.col[1], self->scene->framing.col[2] );
|
|
|
|
return PyString_FromString( rgb );
|
2004-03-14 02:06:57 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------RenderData.GammaLevel() ------------
|
|
|
|
PyObject *RenderData_GammaLevel( BPy_RenderData * self, PyObject * args )
|
2004-03-14 02:06:57 +00:00
|
|
|
{
|
2004-09-25 20:30:40 +00:00
|
|
|
if( self->renderContext->mode & R_UNIFIED ) {
|
|
|
|
return M_Render_GetSetAttributeFloat( args,
|
|
|
|
&self->renderContext->
|
|
|
|
gamma, 0.2f, 5.0f );
|
|
|
|
} else
|
|
|
|
return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
|
|
|
|
"Unified Render must be enabled" ) );
|
2004-03-14 02:06:57 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------RenderData.PostProcessAdd() --------
|
|
|
|
PyObject *RenderData_PostProcessAdd( BPy_RenderData * self, PyObject * args )
|
2004-03-14 02:06:57 +00:00
|
|
|
{
|
2004-09-25 20:30:40 +00:00
|
|
|
if( self->renderContext->mode & R_UNIFIED ) {
|
|
|
|
return M_Render_GetSetAttributeFloat( args,
|
|
|
|
&self->renderContext->
|
|
|
|
postadd, -1.0f, 1.0f );
|
|
|
|
} else
|
|
|
|
return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
|
|
|
|
"Unified Render must be enabled" ) );
|
2004-03-14 02:06:57 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------RenderData.PostProcessMultiply() ---
|
|
|
|
PyObject *RenderData_PostProcessMultiply( BPy_RenderData * self,
|
|
|
|
PyObject * args )
|
2004-03-14 02:06:57 +00:00
|
|
|
{
|
2004-09-25 20:30:40 +00:00
|
|
|
if( self->renderContext->mode & R_UNIFIED ) {
|
|
|
|
return M_Render_GetSetAttributeFloat( args,
|
|
|
|
&self->renderContext->
|
|
|
|
postmul, 0.01f, 4.0f );
|
|
|
|
} else
|
|
|
|
return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
|
|
|
|
"Unified Render must be enabled" ) );
|
2004-03-14 02:06:57 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------RenderData.PostProcessGamma() ------
|
|
|
|
PyObject *RenderData_PostProcessGamma( BPy_RenderData * self, PyObject * args )
|
2004-03-14 02:06:57 +00:00
|
|
|
{
|
2004-09-25 20:30:40 +00:00
|
|
|
if( self->renderContext->mode & R_UNIFIED ) {
|
|
|
|
return M_Render_GetSetAttributeFloat( args,
|
|
|
|
&self->renderContext->
|
|
|
|
postgamma, 0.2f, 2.0f );
|
|
|
|
} else
|
|
|
|
return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
|
|
|
|
"Unified Render must be enabled" ) );
|
2004-03-14 02:06:57 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------RenderData.SGIMaxsize() ------------
|
|
|
|
PyObject *RenderData_SGIMaxsize( BPy_RenderData * self, PyObject * args )
|
2004-03-14 02:06:57 +00:00
|
|
|
{
|
|
|
|
#ifdef __sgi
|
2004-09-25 20:30:40 +00:00
|
|
|
return M_Render_GetSetAttributeShort( args,
|
|
|
|
&self->renderContext->maximsize,
|
|
|
|
0, 500 );
|
2004-03-14 02:06:57 +00:00
|
|
|
#else
|
2004-09-25 20:30:40 +00:00
|
|
|
return ( EXPP_ReturnPyObjError( PyExc_StandardError,
|
|
|
|
"SGI is not defined on this machine" ) );
|
2004-03-14 02:06:57 +00:00
|
|
|
#endif
|
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------RenderData.EnableSGICosmo() --------
|
|
|
|
PyObject *RenderData_EnableSGICosmo( BPy_RenderData * self, PyObject * args )
|
2004-03-14 02:06:57 +00:00
|
|
|
{
|
|
|
|
#ifdef __sgi
|
2004-09-25 20:30:40 +00:00
|
|
|
return M_Render_BitToggleInt( args, R_COSMO,
|
|
|
|
&self->renderContext->mode );
|
2004-03-14 02:06:57 +00:00
|
|
|
#else
|
2004-09-25 20:30:40 +00:00
|
|
|
return ( EXPP_ReturnPyObjError( PyExc_StandardError,
|
|
|
|
"SGI is not defined on this machine" ) );
|
2004-03-14 02:06:57 +00:00
|
|
|
#endif
|
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------RenderData.OldMapValue() -----------
|
|
|
|
PyObject *RenderData_OldMapValue( BPy_RenderData * self, PyObject * args )
|
2004-03-14 02:06:57 +00:00
|
|
|
{
|
2004-09-25 20:30:40 +00:00
|
|
|
return M_Render_GetSetAttributeShort( args,
|
|
|
|
&self->renderContext->framapto,
|
|
|
|
1, 900 );
|
2004-03-14 02:06:57 +00:00
|
|
|
}
|
2004-09-25 20:30:40 +00:00
|
|
|
|
|
|
|
//------------------------------------RenderData.NewMapValue() -----------
|
|
|
|
PyObject *RenderData_NewMapValue( BPy_RenderData * self, PyObject * args )
|
2004-03-14 02:06:57 +00:00
|
|
|
{
|
2004-09-25 20:30:40 +00:00
|
|
|
return M_Render_GetSetAttributeShort( args,
|
|
|
|
&self->renderContext->images, 1,
|
|
|
|
900 );
|
2004-03-14 02:06:57 +00:00
|
|
|
}
|