2.50:
svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r19820:HEAD Notes: * Game and sequencer RNA, and sequencer header are now out of date a bit after changes in trunk. * I didn't know how to port these bugfixes, most likely they are not needed anymore. * Fix "duplicate strip" always increase the user count for ipo. * IPO pinning on sequencer strips was lost during Undo.
This commit is contained in:
@@ -42,23 +42,37 @@ class SCA_IObject;
|
||||
class SCA_PythonController : public SCA_IController
|
||||
{
|
||||
Py_Header;
|
||||
struct _object * m_bytecode;
|
||||
struct _object * m_bytecode; /* SCA_PYEXEC_SCRIPT only */
|
||||
PyObject* m_function; /* SCA_PYEXEC_MODULE only */
|
||||
int m_function_argc;
|
||||
bool m_bModified;
|
||||
bool m_debug; /* use with SCA_PYEXEC_MODULE for reloading every logic run */
|
||||
int m_mode;
|
||||
|
||||
|
||||
protected:
|
||||
STR_String m_scriptText;
|
||||
STR_String m_scriptName;
|
||||
PyObject* m_pythondictionary;
|
||||
PyObject* m_pythondictionary; /* for SCA_PYEXEC_SCRIPT only */
|
||||
PyObject* m_pythonfunction; /* for SCA_PYEXEC_MODULE only */
|
||||
|
||||
std::vector<class SCA_ISensor*> m_triggeredSensors;
|
||||
|
||||
public:
|
||||
enum SCA_PyExecMode
|
||||
{
|
||||
SCA_PYEXEC_SCRIPT = 0,
|
||||
SCA_PYEXEC_MODULE,
|
||||
SCA_PYEXEC_MAX
|
||||
};
|
||||
|
||||
public:
|
||||
static SCA_PythonController* m_sCurrentController; // protected !!!
|
||||
|
||||
//for debugging
|
||||
//virtual CValue* AddRef();
|
||||
//virtual int Release(); // Release a reference to this value (when reference count reaches 0, the value is removed from the heap)
|
||||
|
||||
SCA_PythonController(SCA_IObject* gameobj,PyTypeObject* T = &Type);
|
||||
SCA_PythonController(SCA_IObject* gameobj, int mode, PyTypeObject* T = &Type);
|
||||
virtual ~SCA_PythonController();
|
||||
|
||||
virtual CValue* GetReplica();
|
||||
@@ -67,10 +81,14 @@ class SCA_PythonController : public SCA_IController
|
||||
void SetScriptText(const STR_String& text);
|
||||
void SetScriptName(const STR_String& name);
|
||||
void SetDictionary(PyObject* pythondictionary);
|
||||
void SetDebug(bool debug) { m_debug = debug; }
|
||||
void AddTriggeredSensor(class SCA_ISensor* sensor)
|
||||
{ m_triggeredSensors.push_back(sensor); }
|
||||
int IsTriggered(class SCA_ISensor* sensor);
|
||||
bool Compile();
|
||||
bool Import();
|
||||
void ErrorPrint(const char *error_msg);
|
||||
|
||||
|
||||
static const char* sPyGetCurrentController__doc__;
|
||||
static PyObject* sPyGetCurrentController(PyObject* self);
|
||||
@@ -78,21 +96,18 @@ class SCA_PythonController : public SCA_IController
|
||||
static PyObject* sPyAddActiveActuator(PyObject* self,
|
||||
PyObject* args);
|
||||
static SCA_IActuator* LinkedActuatorFromPy(PyObject *value);
|
||||
|
||||
virtual PyObject* py_getattro(PyObject *attr);
|
||||
virtual PyObject* py_getattro_dict();
|
||||
virtual int py_setattro(PyObject *attr, PyObject *value);
|
||||
|
||||
|
||||
KX_PYMETHOD_O(SCA_PythonController,Activate);
|
||||
KX_PYMETHOD_O(SCA_PythonController,DeActivate);
|
||||
KX_PYMETHOD_DOC_NOARGS(SCA_PythonController,GetSensors);
|
||||
KX_PYMETHOD_DOC_NOARGS(SCA_PythonController,GetActuators);
|
||||
KX_PYMETHOD_DOC_O(SCA_PythonController,GetSensor);
|
||||
KX_PYMETHOD_DOC_O(SCA_PythonController,GetActuator);
|
||||
KX_PYMETHOD_O(SCA_PythonController,SetScript);
|
||||
KX_PYMETHOD_NOARGS(SCA_PythonController,GetScript);
|
||||
KX_PYMETHOD_NOARGS(SCA_PythonController,GetState);
|
||||
|
||||
|
||||
static PyObject* pyattr_get_state(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject* pyattr_get_script(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static int pyattr_set_script(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
|
||||
|
||||
|
Reference in New Issue
Block a user