BPython, two bug fixes:
- #1911: http://projects.blender.org/tracker/?func=detail&atid=125&aid=1911&group_id=9 BOOL properties were returning True always, small mistake in logic.c's getData method. - #1944: http://projects.blender.org/tracker/?func=detail&atid=125&aid=1944&group_id=9 G.vd was not being checked against NULL in Window.ViewLayer, causing a crash when this function was called from a command line script. Now it returns an error in such cases. - small doc updates, tiny minor change in Object.c.
This commit is contained in:
@@ -1799,15 +1799,16 @@ static PyObject *Object_addProperty( BPy_Object * self, PyObject * args )
|
||||
char *prop_type = NULL;
|
||||
short type = -1;
|
||||
BPy_Property *py_prop = NULL;
|
||||
int argslen = PyObject_Length( args );
|
||||
|
||||
if( PyObject_Length( args ) == 3 || PyObject_Length( args ) == 2 ) {
|
||||
if( argslen == 3 || argslen == 2 ) {
|
||||
if( !PyArg_ParseTuple
|
||||
( args, "sO|s", &prop_name, &prop_data, &prop_type ) ) {
|
||||
return ( EXPP_ReturnPyObjError
|
||||
( PyExc_AttributeError,
|
||||
"unable to get string, data, and optional string" ) );
|
||||
}
|
||||
} else if( PyObject_Length( args ) == 1 ) {
|
||||
} else if( argslen == 1 ) {
|
||||
if( !PyArg_ParseTuple( args, "O!", &property_Type, &py_prop ) ) {
|
||||
return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
|
||||
"unable to get Property" ) );
|
||||
|
||||
@@ -798,7 +798,7 @@ static PyObject *M_Window_GetViewMatrix( PyObject * self )
|
||||
static PyObject *M_Window_GetPerspMatrix( PyObject * self )
|
||||
{
|
||||
PyObject *perspmat;
|
||||
|
||||
|
||||
if( !G.vd ) {
|
||||
Py_INCREF( Py_None );
|
||||
return Py_None;
|
||||
@@ -847,9 +847,14 @@ static PyObject *M_Window_ViewLayer( PyObject * self, PyObject * args )
|
||||
PyObject *list = NULL, *resl = NULL;
|
||||
int val, i, bit = 0, layer = 0;
|
||||
|
||||
if( !G.vd ) {
|
||||
return EXPP_ReturnPyObjError( PyExc_RuntimeError,
|
||||
"this function can only be used after a 3d View has been initialized" );
|
||||
}
|
||||
|
||||
if( !PyArg_ParseTuple( args, "|O!", &PyList_Type, &list ) )
|
||||
return EXPP_ReturnPyObjError( PyExc_TypeError,
|
||||
"expected nothing or a list of ints as argument" );
|
||||
"expected nothing or a list of ints as argument" );
|
||||
|
||||
if( list ) {
|
||||
for( i = 0; i < PyList_Size( list ); i++ ) {
|
||||
@@ -911,7 +916,7 @@ static PyObject *M_Window_CameraView( PyObject * self, PyObject * args )
|
||||
|
||||
if( !G.vd )
|
||||
return EXPP_ReturnPyObjError( PyExc_RuntimeError,
|
||||
"View3d not available!" );
|
||||
"this function can only be used after a 3d View has been initialized" );
|
||||
|
||||
if( !G.vd->camera ) {
|
||||
if( BASACT && OBACT->type == OB_CAMERA )
|
||||
|
||||
@@ -164,7 +164,12 @@ Command line mode:
|
||||
"-b" background mode and additions like the "-P" command line switch,
|
||||
L{Blender.Save}, L{Blender.Load}, L{Blender.Quit} and the L{Library} module,
|
||||
for many tasks it's possible to control Blender via some automated process
|
||||
using scripts.
|
||||
using scripts. Note that command line scripts are run before Blender
|
||||
initializes its windows, so many functions that get or set window related
|
||||
attributes (like most in L{Window}) don't work here. If you need those, use
|
||||
an ONLOAD script link (see L{Scene.Scene.addScriptLink}) instead -- it's
|
||||
also possible to use a command line script to write or set an ONLOAD script
|
||||
link.
|
||||
|
||||
Demo mode:
|
||||
----------
|
||||
@@ -294,7 +299,7 @@ A note to newbie script writers:
|
||||
|
||||
@author: The Blender Python Team
|
||||
@requires: Blender 2.35 or newer.
|
||||
@version: 2.35
|
||||
@version: 2.35 - 2.36
|
||||
@see: U{www.blender3d.org<http://www.blender3d.org>}: main site
|
||||
@see: U{www.blender.org<http://www.blender.org>}: documentation and forum
|
||||
@see: U{www.elysiun.com<http://www.elysiun.com>}: user forum
|
||||
|
||||
@@ -4,6 +4,6 @@
|
||||
# run from the doc directory containing the .py files
|
||||
# usage: sh epy_docgen.sh
|
||||
|
||||
epydoc -o BPY_API_234 --url "http://www.blender.org" -t API_intro.py \
|
||||
epydoc -o BPY_API_236 --url "http://www.blender.org" -t API_intro.py \
|
||||
-n "Blender" --no-private --no-frames \
|
||||
$( ls [A-Z]*.py )
|
||||
|
||||
@@ -429,7 +429,7 @@ static PyObject *Property_getData( BPy_Property * self )
|
||||
attr = EXPP_incr_ret( self->data );
|
||||
} else {
|
||||
if( self->property->type == PROP_BOOL ) {
|
||||
if( *( ( int * ) &self->property->poin ) )
|
||||
if( self->property->data )
|
||||
attr = EXPP_incr_ret( Py_True );
|
||||
else
|
||||
attr = EXPP_incr_ret( Py_False );
|
||||
|
||||
Reference in New Issue
Block a user