The following updates have been contributed by Willian P. Germano:
* Implemented BPY_end_python function. * Implemented error handling. This results in rerunning a script after an error has occurred. No need to restart blender anymore. * Camera module supports dir() * variable assignment now calls the Python equivalent function - this has type checking and should be safer now. * Implemented the Lamp module. Used the Camera module as a template. * Implemented the Image module. * Added EXPP_ClampFloat and EXPP_intError functions to gen_utils.[ch] * Implemented 'constant' object.
This commit is contained in:
@@ -39,6 +39,17 @@
|
||||
#include <DNA_object_types.h>
|
||||
#include <DNA_scriptlink_types.h>
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Description: This function clamps a float to the given interval */
|
||||
/* [min, max]. */
|
||||
/*****************************************************************************/
|
||||
float EXPP_ClampFloat (float value, float min, float max)
|
||||
{
|
||||
if (value < min) return min;
|
||||
else if (value > max) return max;
|
||||
return value;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Description: This function returns true if both given strings are equal, */
|
||||
/* otherwise it returns false. */
|
||||
@@ -58,7 +69,7 @@ char * GetIdName (ID *id)
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Description: This function sets an internal string with the given type */
|
||||
/* Description: These functions set an internal string with the given type */
|
||||
/* and error_msg arguments. */
|
||||
/*****************************************************************************/
|
||||
PyObject * PythonReturnErrorObject (PyObject * type, char * error_msg)
|
||||
@@ -67,6 +78,12 @@ PyObject * PythonReturnErrorObject (PyObject * type, char * error_msg)
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
int EXPP_intError (PyObject *type, char *error_msg)
|
||||
{
|
||||
PyErr_SetString (type, error_msg);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Description: This function increments the reference count of the given */
|
||||
/* Python object. */
|
||||
|
Reference in New Issue
Block a user